23 lines
477 B
C++
23 lines
477 B
C++
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
#pragma once
|
|
#ifndef TIMER_HPP
|
|
#define TIMER_HPP
|
|
|
|
#include <chrono>
|
|
#include <string>
|
|
|
|
class UTimer {
|
|
public:
|
|
UTimer();
|
|
void start();
|
|
void stop();
|
|
long long int print(const std::string &s);
|
|
|
|
private:
|
|
std::chrono::time_point<std::chrono::high_resolution_clock> TimeStart;
|
|
std::chrono::duration<double> TimeElapsed;
|
|
long long int Timeusec;
|
|
};
|
|
|
|
#endif /* TIMER_HPP */
|