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(bool start);
25 ~HighResTimer() = default;
26 void Start();
27 void Stop();
28 void Abort();
29 void Reset();
30 void ResetStart();
31 double GetElapsedTime();
32 double GetCurrentElapsedTime(bool reset = false);
33 void StopAndStart(HighResTimer& startTimer);
34 int32_t IsRunning() { return running; }
35 void AddTime(double t);
36
37 private:
38 double ElapsedTime = 0.;
39 double StartTime = 0.;
40 int32_t running = 0;
41
42 static double GetFrequency();
43 static double GetTime();
44 static double Frequency;
45};
46
47#endif
HighResTimer()=default
void AddTime(double t)
Definition timer.cxx:135
void Reset()
Definition timer.cxx:108
~HighResTimer()=default
void Start()
Definition timer.cxx:64
double GetCurrentElapsedTime(bool reset=false)
Definition timer.cxx:117
double GetElapsedTime()
Definition timer.cxx:115
void Abort()
Definition timer.cxx:88
void StopAndStart(HighResTimer &startTimer)
Definition timer.cxx:94
void Stop()
Definition timer.cxx:76
int32_t IsRunning()
Definition timer.h:34
void ResetStart()
Definition timer.cxx:70
GLuint start
Definition glcorearb.h:469