time/delta_time: return nanoseconds objects rather than floats
This commit is contained in:
parent
665c8aa49e
commit
3748b77500
6
time.cpp
6
time.cpp
@ -46,13 +46,13 @@ delta_clock::delta_clock ():
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
float
|
||||
delta_clock::seconds (void)
|
||||
std::chrono::nanoseconds
|
||||
delta_clock::dt (void)
|
||||
{
|
||||
time.prev = time.curr;
|
||||
time.curr = nanoseconds ();
|
||||
|
||||
return (time.curr - time.prev) / static_cast<float> (SECOND);
|
||||
return std::chrono::nanoseconds (time.curr - time.prev);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user