Fix clock in wrong vocabulary.
This commit is contained in:
@ -115,6 +115,20 @@ SIGPIPE SIG_IGN signal drop
|
|||||||
( Modes )
|
( Modes )
|
||||||
octal 777 constant 0777 decimal
|
octal 777 constant 0777 decimal
|
||||||
|
|
||||||
|
( Clock )
|
||||||
|
z" clock_gettime" 2 sysfunc clock_gettime
|
||||||
|
: timespec ( "name" ) create 0 , 0 , ;
|
||||||
|
0 constant CLOCK_REALTIME
|
||||||
|
1 constant CLOCK_MONOTONIC
|
||||||
|
2 constant CLOCK_PROCESS_CPUTIME_ID
|
||||||
|
3 constant CLOCK_THREAD_CPUTIME_ID
|
||||||
|
4 constant CLOCK_MONOTONIC_RAW
|
||||||
|
5 constant CLOCK_REALTIME_COARSE
|
||||||
|
6 constant CLOCK_MONOTONIC_COARSE
|
||||||
|
7 constant CLOCK_BOOTTIME
|
||||||
|
8 constant CLOCK_REALTIME_ALARM
|
||||||
|
9 constant CLOCK_BOOTTIME_ALARM
|
||||||
|
|
||||||
forth definitions posix
|
forth definitions posix
|
||||||
|
|
||||||
( Generic Files )
|
( Generic Files )
|
||||||
@ -139,26 +153,12 @@ O_RDWR constant r/w
|
|||||||
dup 0 SEEK_END lseek r> swap >r
|
dup 0 SEEK_END lseek r> swap >r
|
||||||
SEEK_SET lseek drop r> d0<ior ;
|
SEEK_SET lseek drop r> d0<ior ;
|
||||||
|
|
||||||
( Clock )
|
( Other Utils )
|
||||||
z" clock_gettime" 2 sysfunc clock_gettime
|
: ms ( n -- ) 1000 * usleep drop ;
|
||||||
: timespec ( "name" ) create 0 , 0 , ;
|
|
||||||
0 constant CLOCK_REALTIME
|
|
||||||
1 constant CLOCK_MONOTONIC
|
|
||||||
2 constant CLOCK_PROCESS_CPUTIME_ID
|
|
||||||
3 constant CLOCK_THREAD_CPUTIME_ID
|
|
||||||
4 constant CLOCK_MONOTONIC_RAW
|
|
||||||
5 constant CLOCK_REALTIME_COARSE
|
|
||||||
6 constant CLOCK_MONOTONIC_COARSE
|
|
||||||
7 constant CLOCK_BOOTTIME
|
|
||||||
8 constant CLOCK_REALTIME_ALARM
|
|
||||||
9 constant CLOCK_BOOTTIME_ALARM
|
|
||||||
: ms-ticks ( -- n )
|
: ms-ticks ( -- n )
|
||||||
0 >r 0 >r CLOCK_MONOTONIC_RAW rp@ cell - clock_gettime throw
|
0 >r 0 >r CLOCK_MONOTONIC_RAW rp@ cell - clock_gettime throw
|
||||||
r> 1000000 / r> 1000 * + ;
|
r> 1000000 / r> 1000 * + ;
|
||||||
|
|
||||||
( Other Utils )
|
|
||||||
: ms ( n -- ) 1000 * usleep drop ;
|
|
||||||
|
|
||||||
forth
|
forth
|
||||||
|
|
||||||
( Setup entry )
|
( Setup entry )
|
||||||
|
|||||||
Reference in New Issue
Block a user