[][src]Function tarantool_module::clock::thread

pub fn thread() -> f64

The thread time.

Derived from C function clock_gettime(CLOCK_THREAD_CPUTIME_ID). This is the best function to use with benchmarks that need to calculate how much time has been spent within a thread within a CPU.

Return: seconds or nanoseconds since the transaction processor thread started. Return type: u64 or f64

Example:

// This will print seconds in the thread since the start.
use tarantool_module::clock::thread64;
println!("{}", thread64());