get_chronotime: Measure elapsed time with C++11 chrono library

View source: R/RcppExports.R

get_chronotimeR Documentation

Measure elapsed time with C++11 chrono library

Description

Returns a time indicator that can be used to accurately measure elapsed time. The C++11 clock used is chrono::high_resolution_clock.

Usage

get_chronotime()

Value

A double with the number of nanoseconds elapsed since a fixed epoch.

Examples

# Measure 1 second sleep
initT<-get_chronotime()
Sys.sleep(1)
measT<-(get_chronotime()-initT)*1e-9
cat("1 second passed in ",measT," seconds.\n")

dazzimonti/anMC documentation built on Aug. 27, 2023, 10:18 p.m.