You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
443 B
17 lines
443 B
7 years ago
|
#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());
|
||
|
}
|
||
|
|