ATLAS Offline Software
Timer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <chrono>
6 #include <iostream>
7 
8 using namespace std::chrono;
9 
10 struct Timer{
11 
12  void timeit(){
13 
15  int ndo = 1000000;
16  int i{0};
17  for (int i = 0; i != ndo; ++i){
18  i += 1;
19  i -= 1;
20  }
22  std::cout << i << '\n';
23  std::cout << duration_cast<milliseconds>(t1-t0).count()
24  <<"ms\n";
25  }
26 };
27 
28 int main(){
29  Timer timer;
30  timer.timeit();
31 }
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
Timer::Timer
Timer()
Definition: main_benchmark.cxx:77
python.handimod.now
now
Definition: handimod.py:675
lumiFormat.i
int i
Definition: lumiFormat.py:92
main
int main()
Definition: Timer.cxx:28
Timer::timeit
void timeit()
Definition: Timer.cxx:12