Initial commit
This commit is contained in:
commit
4f4397b3e1
48 changed files with 2002 additions and 0 deletions
26
VectorFiller/atlas/time/impl/HighResolutionTimer.h
Normal file
26
VectorFiller/atlas/time/impl/HighResolutionTimer.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// -*- mode: c++ -*-
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../time.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace atlas::time {
|
||||
class HighResolutionTimer : public Timer<std::chrono::milliseconds> {
|
||||
public:
|
||||
void start() override
|
||||
{
|
||||
m_start = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
auto elapsed() const -> duration_type override
|
||||
{
|
||||
return std::chrono::duration_cast<duration_type>(std::chrono::high_resolution_clock::now() - m_start);
|
||||
}
|
||||
|
||||
private:
|
||||
std::chrono::high_resolution_clock::time_point m_start;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue