Add basic responsive layout for Phone

This commit is contained in:
Vyn 2024-05-04 17:38:23 +02:00
parent 1416b5db58
commit 375a1bfb2d
7 changed files with 360 additions and 293 deletions

View file

@ -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;