Last change
on this file since 636 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
-
Property svn:keywords set to
Id
|
File size:
555 bytes
|
Line | |
---|
1 | #include <stdio.h> |
---|
2 | #include <stdlib.h> |
---|
3 | #include <sys/time.h> |
---|
4 | #include <unistd.h> |
---|
5 | #include "timing.hpp" |
---|
6 | |
---|
7 | void timer_init() { ; } |
---|
8 | void timer_uninit() { ; } |
---|
9 | |
---|
10 | |
---|
11 | double time_marker::diff_time(time_marker *other) |
---|
12 | { |
---|
13 | return (double)(seconds-other->seconds)+ (double)(micro_seconds-other->micro_seconds)/1000000; |
---|
14 | } |
---|
15 | |
---|
16 | void time_marker::get_time() |
---|
17 | { |
---|
18 | struct timezone tz={0,DST_USA}; |
---|
19 | gettimeofday((struct timeval *)&seconds,&tz); |
---|
20 | } |
---|
21 | |
---|
22 | time_marker::time_marker() |
---|
23 | { get_time(); } |
---|
24 | |
---|
25 | void milli_wait(unsigned wait_time) |
---|
26 | { |
---|
27 | usleep((long)wait_time*(long)1000); |
---|
28 | } |
---|
29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.