mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 14:45:58 +01:00
17 lines
No EOL
472 B
C++
17 lines
No EOL
472 B
C++
#include "Timer.hpp"
|
|
|
|
void CTimer::reset() {
|
|
m_tpLastReset = std::chrono::system_clock::now();
|
|
}
|
|
|
|
std::chrono::system_clock::duration CTimer::getDuration() {
|
|
return std::chrono::system_clock::now() - m_tpLastReset;
|
|
}
|
|
|
|
int CTimer::getMillis() {
|
|
return std::chrono::duration_cast<std::chrono::milliseconds>(getDuration()).count();
|
|
}
|
|
|
|
float CTimer::getSeconds() {
|
|
return std::chrono::duration_cast<std::chrono::milliseconds>(getDuration()).count() / 1000.f;
|
|
} |