iw4x-client/src/Utils/Time.cpp

18 lines
320 B
C++
Raw Normal View History

2016-11-05 07:56:12 -04:00
#include "STDInclude.hpp"
namespace Utils
{
namespace Time
{
void Interval::update()
2016-11-05 07:56:12 -04:00
{
this->lastPoint = std::chrono::high_resolution_clock::now();
2016-11-05 07:56:12 -04:00
}
bool Interval::elapsed(std::chrono::nanoseconds nsecs)
2016-11-05 07:56:12 -04:00
{
return ((std::chrono::high_resolution_clock::now() - this->lastPoint) >= nsecs);
2016-11-05 07:56:12 -04:00
}
}
}