summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs12
1 files changed, 9 insertions, 3 deletions
diff --git a/jefs.fs b/jefs.fs
index d8fce50..e8dfd99 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -445,18 +445,24 @@ make old-termios old-termios# allot
\ TIME {{{
: nanosleep 35 syscall2 ;
+: clock_gettime 228 syscall2 ;
+
+0 constant CLOCK_REALTIME 1 constant CLOCK_MONOTONIC
+7 constant CLOCK_BOOTTIME
16 constant timespec#
make timespec timespec# allot
-: timespec.tv_sec timespec ;
-: timespec.tv_nsec timespec 8 + ;
+: timespec.tv_sec ;
+: timespec.tv_nsec 8 + ;
: ms>ns ( u -- u' ) 1000000 * ;
: ns>ms ( u -- u' ) 1000000 / ;
: ms>sec ( u -- ms sec ) 1000 /mod ;
-: ms ( u -- ) ms>sec timespec.tv_sec ! ms>ns timespec.tv_nsec ! 0 timespec nanosleep errno .errno ;
+: ms ( u -- ) ms>sec timespec timespec.tv_sec !
+ ms>ns timespec timespec.tv_nsec !
+ 0 timespec nanosleep errno .errno ;
\ }}}
\ DUMP {{{