#!
( "...<eol>" -- )
=> "EXTENSIONS"
ignores the rest of the line,
defining `#!' is used to support forth scripts
executed by the unix kernel
primitive code = [p4_ignore_line]
GETTIMEOFDAY
( -- milliseconds# epochseconds# )
[EXT]
=> "EXTENSIONS"
returns SVR/BSD gettimeofday(2).
Incompatible with 16-bit systems as the numbers can not be properly
represented, hence TIME&DATE
is more portable.
primitive code = [gettimeofday]
MS@
( -- milliseconds# )
[EXT]
=> "EXTENSIONS"
elapsed time since start of process (or system) - in millseconds.
The granularity is per clockticks as per ENVIRONMENT CLOCKS_PER_SEC
For the current wallclock in milliseconds, ask GETTIMEOFDAY
.
Remember that the process clock will wrap around at some point,
therefore only use difference values between two clock reads.
see also CLOCK@
and MS
primitive code = [p4_milliseconds_fetch]
CLOCK@
( --- clock-ticks# )
[EXT]
=> "EXTENSIONS"
return clock(2) - the number of clocks of this proces.
To get the number of seconds, divide by CLOCKS_PER_SEC a.k.a. CLK_TCK
as represented in the ENVIROMENT
for a hosted forth system.
Remember that the process clock will wrap around at some point,
therefore only use difference values between two clock reads.
primitive code = [p4_clock_fetch]