Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
chhwang committed Aug 15, 2024
1 parent f7c6867 commit 2d51327
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
16 changes: 0 additions & 16 deletions ark/cpu_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,4 @@ double cpu_timer(void) {
return (tspec.tv_nsec / 1.0e9) + tspec.tv_sec;
}

// Sleep in second.
int cpu_timer_sleep(double sec) {
struct timespec tspec;
tspec.tv_sec = (time_t)sec;
tspec.tv_nsec = (long)((sec - tspec.tv_sec) * 1.0e9);
return nanosleep(&tspec, 0);
}

// Sleep in nanosecond.
int cpu_ntimer_sleep(long nsec) {
struct timespec tspec;
tspec.tv_sec = 0;
tspec.tv_nsec = nsec;
return nanosleep(&tspec, 0);
}

} // namespace ark
4 changes: 0 additions & 4 deletions ark/cpu_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ namespace ark {

// Measure current time in second.
double cpu_timer(void);
// Sleep in second.
int cpu_timer_sleep(double sec);
// Sleep in nanosecond.
int cpu_ntimer_sleep(long nsec);

} // namespace ark

Expand Down

0 comments on commit 2d51327

Please sign in to comment.