ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypoUnitTests
src
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
14
auto
t0
= high_resolution_clock::now();
15
int
ndo = 1000000;
16
int
i{0};
17
for
(
int
i = 0; i != ndo; ++i){
18
i += 1;
19
i -= 1;
20
}
21
auto
t1 = high_resolution_clock::now();
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
}
t0
static Double_t t0
Definition
LArPhysWaveHECTool.cxx:38
main
int main()
Definition
Timer.cxx:28
Timer
Definition
Timer.cxx:10
Timer::timeit
void timeit()
Definition
Timer.cxx:12
Generated on
for ATLAS Offline Software by
1.14.0