-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05cca15
commit a733ec8
Showing
6 changed files
with
165 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
#ifndef TIMEMANAGER_H | ||
#define TIMEMANAGER_H | ||
|
||
#include <chrono> | ||
|
||
class TimeManager { | ||
public: | ||
// Get the current time in microseconds since epoch | ||
static uint64_t getCurrentTimeUsec(); | ||
|
||
// Get the current time in seconds since epoch (with fractional seconds) | ||
static double getCurrentTimeSec(); // <-- Add this line | ||
|
||
// Calculate elapsed time in microseconds since the last call | ||
static uint64_t calculateElapsedTimeUsec(uint64_t& lastTime); | ||
|
||
private: | ||
// Use a high-resolution clock for time measurements | ||
using HighResClock = std::chrono::high_resolution_clock; | ||
}; | ||
|
||
#endif // TIMEMANAGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.