pfe-facility-mix-ext
Prev? | pfe Forth Wordset List | ?Next

## Name

pfe-facility-mix-ext ? FACILITY-MIX extra words

## Synopsis

`#! ( "...&lt;eol&gt;" -- ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`GETTIMEOFDAY ( -- milliseconds# epochseconds# ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`MS@ ( -- milliseconds# ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`CLOCK@ ( --- clock-ticks# ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

## Description

#! ( "...&lt;eol&gt;" -- ) => "EXTENSIONS"

ignores the rest of the line, defining `#!' is used to support forth scripts executed by the unix kernel

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.

MS@ ( -- milliseconds# ) [EXT] => "EXTENSIONS"

elapsed time since start of process (or system) - in millseconds. The granularity is per clock ticks as per `ENVIRONMENT CLOCKS_PER_SEC` For the current wall clock in milliseconds, ask `GETTIMEOFDAY`.

Remember that the process clock will wrap around at some point, therefore only use difference values between two clock reads. Also note that on many desktop systems the process scheduler ticks per 1/100s or 1/60s so that the difference of two continuous reads of the process clock will show steps of 10 to 16 milliseconds.

see also `CLOCK@` and `MS`

CLOCK@ ( --- clock-ticks# ) [EXT] => "EXTENSIONS"

return clock(2) - the number of clocks of this process. To get the number of seconds, divide by `CLOCKS_PER_SEC` as represented in the `ENVIROMENT` for a hosted forth system. A similar scheme is used by `MS@` to compute the clock time rounded to milliseconds (named in similarity with `MS` sleep).

Remember that the process clock will wrap around at some point, therefore only use difference values between two clock reads.

Prev? | Up | ?Next
pfe-facility-ext? | Home | ?pfe-file-ext