mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2025-12-19 23:50:02 +01:00
17 lines
357 B
C++
17 lines
357 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <functional>
|
||
|
|
#include <chrono>
|
||
|
|
|
||
|
|
class CTimer {
|
||
|
|
public:
|
||
|
|
CTimer(float ms, std::function<void()> callback);
|
||
|
|
|
||
|
|
bool passed() const;
|
||
|
|
|
||
|
|
std::function<void()> m_fnCallback;
|
||
|
|
|
||
|
|
private:
|
||
|
|
std::chrono::high_resolution_clock::time_point m_tStart;
|
||
|
|
float m_fDuration;
|
||
|
|
};
|