Project
Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef QONMODULE_TIMER_H
16#define QONMODULE_TIMER_H
17
18#include <cstdint>
19
21{
22 public:
23 HighResTimer() = default;
24 ~HighResTimer() = default;
25 void Start();
26 void Stop();
27 void Abort();
28 void Reset();
29 void ResetStart();
30 double GetElapsedTime();
31 double GetCurrentElapsedTime(bool reset = false);
32 void StopAndStart(HighResTimer& startTimer);
33 int32_t IsRunning() { return running; }
34 void AddTime(double t);
35
36 private:
37 double ElapsedTime = 0.;
38 double StartTime = 0.;
39 int32_t running = 0;
40
41 static double GetFrequency();
42 static double GetTime();
43 static double Frequency;
44};
45
46#endif
HighResTimer()=default
void AddTime(double t)
Definition timer.cxx:128
void Reset()
Definition timer.cxx:101
~HighResTimer()=default
void Start()
Definition timer.cxx:57
double GetCurrentElapsedTime(bool reset=false)
Definition timer.cxx:110
double GetElapsedTime()
Definition timer.cxx:108
void Abort()
Definition timer.cxx:81
void StopAndStart(HighResTimer &startTimer)
Definition timer.cxx:87
void Stop()
Definition timer.cxx:69
int32_t IsRunning()
Definition timer.h:33
void ResetStart()
Definition timer.cxx:63