34 from = std::chrono::high_resolution_clock::now();
37 return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() -
from).count() * 1.0e-9;
41 return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count() * 1.0e-9;
45 std::chrono::high_resolution_clock::time_point
from;
56 interval (
std::chrono::duration_cast<
std::chrono::high_resolution_clock::duration> (
std::chrono::nanoseconds (
std::chrono::nanoseconds::rep (1.0e9*time_interval)))),
63 auto now = std::chrono::high_resolution_clock::now();
72 const std::chrono::high_resolution_clock::duration
interval;
73 std::chrono::high_resolution_clock::time_point
next_time;
IntervalTimer(double time_interval=0.0333333)
by default, fire at ~30 Hz - most monitors are 60Hz
std::chrono::high_resolution_clock::time_point next_time
const std::chrono::high_resolution_clock::duration interval
std::chrono::high_resolution_clock::time_point from
static double current_time()