Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastMoE
Commits
30283570
Commit
30283570
authored
Dec 17, 2020
by
Rick Ho
Browse files
add timer
parent
2b5672e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
pytorch/cuda/timer.hh
pytorch/cuda/timer.hh
+16
-0
No files found.
pytorch/cuda/timer.hh
0 → 100644
View file @
30283570
#ifndef TIMER_HH
#define TIMER_HH
#include <chrono>
inline
double
getDuration
(
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
a
,
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
b
)
{
return
std
::
chrono
::
duration
<
double
>
(
b
-
a
).
count
();
}
#define timestamp(__var__) auto __var__ = std::chrono::system_clock::now();
#include <chrono>
#endif // TIMER_HH
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