mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-15 20:50:08 -04:00
Fix Clang compilation with gig
This commit is contained in:
27
src/core/MicroTimer.cpp
Normal file
27
src/core/MicroTimer.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "MicroTimer.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::chrono;
|
||||
|
||||
static_assert(ratio_less_equal<steady_clock::duration::period, micro>::value,
|
||||
"MicroTimer: steady_clock doesn't support microsecond resolution");
|
||||
|
||||
MicroTimer::MicroTimer()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
MicroTimer::~MicroTimer()
|
||||
{
|
||||
}
|
||||
|
||||
void MicroTimer::reset()
|
||||
{
|
||||
begin = steady_clock::now();
|
||||
}
|
||||
|
||||
int MicroTimer::elapsed() const
|
||||
{
|
||||
auto now = steady_clock::now();
|
||||
return std::chrono::duration_cast<std::chrono::duration<int, std::micro>>(now - begin).count();
|
||||
}
|
||||
Reference in New Issue
Block a user