Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
6aa8adcb
Commit
6aa8adcb
authored
May 22, 2015
by
Michael Arntzenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow creating a Timer w/o starting it
parent
a4a6e650
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
src/core/util.cpp
src/core/util.cpp
+3
-0
src/core/util.h
src/core/util.h
+2
-0
No files found.
src/core/util.cpp
View file @
6aa8adcb
...
...
@@ -43,6 +43,9 @@ uint64_t getCPUTicks() {
int
Timer
::
level
=
0
;
Timer
::
Timer
(
long
min_usec
)
:
min_usec
(
min_usec
),
ended
(
true
)
{
}
Timer
::
Timer
(
const
char
*
desc
,
long
min_usec
)
:
min_usec
(
min_usec
),
ended
(
true
)
{
restart
(
desc
);
}
...
...
src/core/util.h
View file @
6aa8adcb
...
...
@@ -36,7 +36,9 @@ private:
std
::
function
<
void
(
uint64_t
)
>
exit_callback
;
public:
// Timers with non-NULL desc will print times longer than min_usec for debugging when VERBOSITY("time") >= 2
Timer
(
const
char
*
desc
=
NULL
,
long
min_usec
=
-
1
);
Timer
(
long
min_usec
);
// doesn't start the timer
~
Timer
();
void
setExitCallback
(
std
::
function
<
void
(
uint64_t
)
>
_exit_callback
)
{
exit_callback
=
_exit_callback
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment