Chapter 4. Timestamp Functions
Each timestamp function returns a value to indicate when a function is executed. These returned values can then be used to indicate when an event occurred, provide an ordering for events, or compute the amount of time elapsed between two time stamps.
Name
function::get_cycles — Processor cycle count.
Synopsis
function get_cycles:long()
General Syntax
get_cycles:long
Description
This function returns the processor cycle counter value if available, else it returns zero. The cycle counter is free running and unsynchronized on each processor. Thus, the order of events cannot determined by comparing the results of the get_cycles function on different processors.
Name
function::gettimeofday_ns — Number of nanoseconds since UNIX epoch.
Synopsis
function gettimeofday_ns:long()
General Syntax
gettimeofday_ns:long
Description
This function returns the number of nanoseconds since the UNIX epoch.
Name
function::gettimeofday_us — Number of microseconds since UNIX epoch.
Synopsis
function gettimeofday_us:long()
General Syntax
gettimeofday_us:long
Description
This function returns the number of microseconds since the UNIX epoch.
Name
function::gettimeofday_ms — Number of milliseconds since UNIX epoch.
Synopsis
function gettimeofday_ms:long()
General Syntax
gettimeofday_ms:long
Description
This function returns the number of milliseconds since the UNIX epoch.
Name
function::gettimeofday_s — Number of seconds since UNIX epoch.
Synopsis
function gettimeofday_s:long()
General Syntax
gettimeofday_s:long
Description
This function returns the number of seconds since the UNIX epoch.