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
5a334993
There was an error fetching the commit references. Please try again later.
Commit
5a334993
authored
6 years ago
by
Nina Džugasová
Committed by
Tomáš Oberhuber
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Modified the Timer documentation.
parent
3e39df89
No related branches found
No related tags found
1 merge request
!15
Nina
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Examples/TimerExample.cpp
+1
-0
1 addition, 0 deletions
src/Examples/TimerExample.cpp
src/TNL/Timer.h
+15
-8
15 additions, 8 deletions
src/TNL/Timer.h
with
16 additions
and
8 deletions
src/Examples/TimerExample.cpp
+
1
−
0
View file @
5a334993
...
...
@@ -15,5 +15,6 @@ int main()
cout
<<
"before reset:"
<<
time
.
getRealTime
()
<<
endl
;
time
.
reset
();
cout
<<
"after reset:"
<<
time
.
getRealTime
()
<<
endl
;
// writeLog example
}
This diff is collapsed.
Click to expand it.
src/TNL/Timer.h
+
15
−
8
View file @
5a334993
...
...
@@ -17,6 +17,7 @@ class Logger;
/// \brief Class for time measuring.
///
/// Counts the elapsed time in seconds between the start() and stop() methods.
/// \par Example
/// \include TimerExample.cpp
// \par Output
...
...
@@ -56,7 +57,7 @@ class Timer
/////
/// \brief Returns the elapsed time on given timer.
///
/// It returns the elapsed time between calling the start() and stop() methods.
/// It returns the elapsed time
(in seconds)
between calling the start() and stop() methods.
/// Starts counting the real time after the method start() is called and
/// pauses when the method stop() is called.
/// If the timer have been started more then once without resetting,
...
...
@@ -69,17 +70,23 @@ class Timer
/////
/// \brief Returns the elapsed CPU time on given timer.
///
/// CPU time is the time that measures how long it takes processor
/// to complete all computations.
/// The CPU time is measured in seconds.
/// CPU time is the amount of time for which a central processing unit (CPU)
/// was used for processing instructions of a computer program or operating system.
/// The CPU time is measured by adding the amount of CPU time between start() and stop()
/// methods together.
double
getCPUTime
()
const
;
/// Returns the number of CPU cycles (machine cycles).
/// \brief Returns the number of CPU cycles (machine cycles).
///
/// CPU cycles are counted by adding the number of CPU cycles between start() and stop()
/// methods together.
unsigned
long
long
int
getCPUCycles
()
const
;
/// \brief Writes a record into the \e logger.
///
/// \param logger
/// \param logLevel A
whole number from zero up, which indicates the
indent.
/// \param logLevel A
non-negative integer recording the log record
indent.
bool
writeLog
(
Logger
&
logger
,
int
logLevel
=
0
)
const
;
protected:
...
...
@@ -91,8 +98,8 @@ class Timer
/// \brief Function for measuring the CPU time.
///
/// CPU time is the
time that measures how long it takes processor
///
to complete all computations
.
/// CPU time is the
amount of time for which a central processing unit (CPU)
///
was used for processing instructions of a computer program or operating system
.
double
readCPUTime
()
const
;
/// \brief Function for counting the number of CPU cycles (machine cycles).
...
...
@@ -106,7 +113,7 @@ class Timer
/// \brief Saves information about the state of given timer.
///
/// Knows whether the timer is currently stopped or
not
.
/// Knows whether the timer is currently stopped or
it is running
.
bool
stopState
;
/// \brief Time Stamp Counter returning number of CPU cycles since reset.
...
...
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