1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types alien.syntax
4 classes.struct kernel math unix.types ;
15 : <timeval> ( sec usec -- timeval )
20 : make-timeval ( us -- timeval )
22 1000000 /mod [ >>sec ] [ >>usec ] bi*
25 : make-timespec ( nanos -- timespec )
26 [ timespec new ] dip [
27 1000000000 /mod [ >>sec ] [ >>nsec ] bi*
47 FUNCTION: time_t time ( time_t* t )
48 FUNCTION: tm* localtime ( time_t* clock )
49 FUNCTION: int gettimeofday ( timespec* TP, void* TZP )
50 FUNCTION: int settimeofday ( timeval* TP, timezone* TZP )
51 FUNCTION: int adjtime ( timeval* delta, timeval* olddelta )