OPAL (Object Oriented Parallel Accelerator Library)
2022.1
OPAL
src
ippl
src
Utility
Timer.h
Go to the documentation of this file.
1
//
2
// Class Timer
3
// This class is used in IpplTimings.
4
// https://www.boost.org/doc/libs/1_70_0/libs/timer/doc/cpu_timers.html
5
//
6
// Copyright (c) 2019, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
7
// All rights reserved
8
//
9
// Implemented as part of the PhD thesis
10
// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
11
//
12
// This file is part of OPAL.
13
//
14
// OPAL is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
// You should have received a copy of the GNU General Public License
20
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21
//
22
#ifndef TIMER_H
23
#define TIMER_H
24
25
#include <boost/timer/timer.hpp>
26
27
class
Timer
28
{
29
public
:
30
31
Timer
();
32
33
void
clear
();
// Set all accumulated times to 0
34
void
start
();
// Start timer
35
void
stop
();
// Stop timer
36
37
double
clock_time
();
// Report clock time accumulated in seconds
38
double
user_time
();
// Report user time accumlated in seconds
39
double
system_time
();
// Report system time accumulated in seconds
40
double
cpu_time
();
// Report total cpu_time which is just user_time + system_time
41
42
private
:
43
double
wall_m
;
44
double
user_m
;
45
double
sys_m
;
46
boost::timer::cpu_timer
timer_m
;
47
};
48
49
#endif
Timer
Definition:
Timer.h:28
Timer::timer_m
boost::timer::cpu_timer timer_m
Definition:
Timer.h:46
Timer::start
void start()
Definition:
Timer.cpp:34
Timer::user_time
double user_time()
Definition:
Timer.cpp:55
Timer::Timer
Timer()
Definition:
Timer.cpp:24
Timer::stop
void stop()
Definition:
Timer.cpp:39
Timer::clear
void clear()
Definition:
Timer.cpp:29
Timer::wall_m
double wall_m
Definition:
Timer.h:43
Timer::clock_time
double clock_time()
Definition:
Timer.cpp:50
Timer::user_m
double user_m
Definition:
Timer.h:44
Timer::cpu_time
double cpu_time()
Definition:
Timer.cpp:65
Timer::system_time
double system_time()
Definition:
Timer.cpp:60
Timer::sys_m
double sys_m
Definition:
Timer.h:45
Generated on Thu Oct 20 2022 17:40:12 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.3