I'm trying to use chrono library for timers and durations.
I want to be able to have a Duration frameStart;
( from app start )
and a Duration frameDelta;
( time between frames )
I need to be able to get the frameDelta
duration as milliseconds and float seconds.
How do you do this with the new c++11 <chrono>
libraries? I've been working on it and googling ( information is sparse ). The code is heavily templated and requires special casts and things, I can't figure out how to use this library correctly.
I don't know what "milliseconds and float seconds" means, but this should give you an idea:
Taking a guess at what it is you're asking for. I'm assuming by millisecond frame timer you're looking for something that acts like the following,
but uses
std::chrono
instead,Hope this helps.
In AAA style using the explicitly typed initializer idiom:
Is this what you're looking for?
which for me prints out: