Function tarantool::clock::time

source ·
pub fn time() -> f64
Expand description

The wall clock time in seconds.

Derived from C function clock_gettime(CLOCK_REALTIME). This is the best function for knowing what the official time is, as determined by the system administrator.

Return: seconds since epoch (1970-01-01 00:00:00), adjusted.

Example:

// This will print an approximate number of years since 1970.
use tarantool::clock::time;
println!("{}", time() / (365. * 24. * 60. * 60.));

See also: fiber::time(), fiber::time64()