Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
bcb3df95
There was an error fetching the commit references. Please try again later.
Commit
bcb3df95
authored
6 years ago
by
Nina Džugasová
Committed by
Tomáš Oberhuber
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Better documentation of Timer.
parent
bad9de0c
No related branches found
No related tags found
1 merge request
!15
Nina
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Timer.h
+23
-11
23 additions, 11 deletions
src/TNL/Timer.h
with
23 additions
and
11 deletions
src/TNL/Timer.h
+
23
−
11
View file @
bcb3df95
...
@@ -23,7 +23,7 @@ class Timer
...
@@ -23,7 +23,7 @@ class Timer
/////
/////
/// \brief Basic constructor.
/// \brief Basic constructor.
///
///
/// This function creates a new timer.
/// This function creates a new timer
and resets it
.
Timer
();
Timer
();
/////
/////
...
@@ -34,48 +34,60 @@ class Timer
...
@@ -34,48 +34,60 @@ class Timer
void
reset
();
void
reset
();
////
////
/// \brief Stops timer.
/// \brief Stops
(pauses) the
timer.
///
///
/// Stops all time and cycle measurements such as real time, CPU time and CPU cycles.
/// Pauses all time and cycle measurements such as real time, CPU time and
/// CPU cycles, but does not set them to zero.
void
stop
();
void
stop
();
/////
/////
/// \brief Starts timer.
/// \brief Starts timer.
///
///
/// Starts all time and cycle measurements such as real time, CPU time and CPU cycles.
/// Starts all time and cycle measurements such as real time, CPU time and
/// CPU cycles. Function start() can be used also after using stop() function.
/// The timer then continues measuring the time without reseting.
void
start
();
void
start
();
/// \brief Counts the real (clock) time starting after the function \c start() is called.
/// \brief Returs the real (clock/timer) time.
///
/// It returns the elapsed time between calling the start() and stop() functions.
/// Starts counting the real time after the function start() is called and
/// pauses when the function stop() is called.
/// If the timer have been started more then one time without resetting,
/// the real time is counted by adding all intervals (between start and stop
/// functions) together.
/// This function can be called while the timer is running, there is no
/// need to use stop() function first.
double
getRealTime
()
const
;
double
getRealTime
()
const
;
/////
/////
/// \brief
Meas
ur
e
s the CPU time.
/// \brief
Ret
ur
n
s the CPU time.
///
///
/// CPU time is the time that measures how long it takes processor
/// CPU time is the time that measures how long it takes processor
/// to complete all computations.
/// to complete all computations.
double
getCPUTime
()
const
;
double
getCPUTime
()
const
;
///
Count
s the number of CPU cycles (machine cycles).
///
Return
s the number of CPU cycles (machine cycles).
unsigned
long
long
int
getCPUCycles
()
const
;
unsigned
long
long
int
getCPUCycles
()
const
;
/// \brief Writes a record to the \e logger.
/// \brief Writes a record to the \e logger.
///
///
/// \param logger
/// \param logger
/// \param logLevel
/// \param logLevel
A whole number from zero up, which indicates the indent.
bool
writeLog
(
Logger
&
logger
,
int
logLevel
=
0
)
const
;
bool
writeLog
(
Logger
&
logger
,
int
logLevel
=
0
)
const
;
protected:
protected:
/// Function for
r
ea
d
ing the real time.
/// Function for
m
ea
sur
ing the real time.
double
readRealTime
()
const
;
double
readRealTime
()
const
;
/// \brief Function for
r
ea
d
ing the CPU time.
/// \brief Function for
m
ea
sur
ing the CPU time.
///
///
/// CPU time is the time that measures how long it takes processor
/// CPU time is the time that measures how long it takes processor
/// to complete all computations.
/// to complete all computations.
double
readCPUTime
()
const
;
double
readCPUTime
()
const
;
/// \brief Function for
read
ing the number of CPU cycles (machine cycles).
/// \brief Function for
count
ing the number of CPU cycles (machine cycles).
unsigned
long
long
int
readCPUCycles
()
const
;
unsigned
long
long
int
readCPUCycles
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment