quick save before the main.cpp refactor
This commit is contained in:
16
src/Application.cpp
Normal file
16
src/Application.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "Application.h"
|
||||
|
||||
float Application::elap_time() {
|
||||
static std::chrono::time_point<std::chrono::system_clock> start;
|
||||
static bool started = false;
|
||||
|
||||
if (!started) {
|
||||
start = std::chrono::system_clock::now();
|
||||
started = true;
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> now = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed_time = now - start;
|
||||
return static_cast<float>(elapsed_time.count());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user