Time the stress test

This commit is contained in:
Henrik Rydgård committed 2022-04-08 11:55:49 +02:00
1 parent b04e5925d2
commit e0f73507f9
3 files changed
+20 -1

No files matched your search

+14
View File
@@ -7,3 +7,17 @@ double time_now_d();
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_;
};