mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add basic responsive layout for Phone
This commit is contained in:
parent
1416b5db58
commit
375a1bfb2d
7 changed files with 360 additions and 293 deletions
|
@ -19,19 +19,19 @@ namespace cpputils::debug
|
|||
class Timer
|
||||
{
|
||||
public:
|
||||
Timer() : startTime(std::chrono::high_resolution_clock::now())
|
||||
Timer() : startTime(std::chrono::steady_clock::now())
|
||||
{
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
startTime = std::chrono::high_resolution_clock::now();
|
||||
startTime = std::chrono::steady_clock::now();
|
||||
isRunning = true;
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
const auto now = std::chrono::high_resolution_clock::now();
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
duration += std::chrono::duration_cast<std::chrono::microseconds>(now - startTime).count();
|
||||
isRunning = false;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class Timer
|
|||
{
|
||||
long durationToShow = duration;
|
||||
if (isRunning) {
|
||||
const auto now = std::chrono::high_resolution_clock::now();
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
durationToShow +=
|
||||
std::chrono::duration_cast<std::chrono::microseconds>(now - startTime).count();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class Timer
|
|||
}
|
||||
|
||||
private:
|
||||
std::chrono::time_point<std::chrono::system_clock> startTime;
|
||||
std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> startTime;
|
||||
|
||||
// Timer are always running when created. You can use .reset() after creation.
|
||||
bool isRunning = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue