Learn R Programming

anMC (version 0.2.5)

get_chronotime: 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()

Arguments

Value

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

Examples

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

Run the code above in your browser using DataLab