mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-03 19:21:13 +00:00
24 lines
500 B
C++
24 lines
500 B
C++
#pragma once
|
|
|
|
// Seconds.
|
|
double time_now_d();
|
|
|
|
// Sleep. Does not necessarily have millisecond granularity, especially on Windows.
|
|
void sleep_ms(int ms);
|
|
|
|
void GetTimeFormatted(char formattedTime[13]);
|
|
|
|
// Rust-style Instant for clear and easy timing.
|
|
class Instant {
|
|
public:
|
|
static Instant Now() {
|
|
return Instant(time_now_d());
|
|
}
|
|
double Elapsed() const {
|
|
return time_now_d() - instantTime_;
|
|
}
|
|
private:
|
|
explicit Instant(double initTime) : instantTime_(initTime) {}
|
|
double instantTime_;
|
|
};
|