Last change
on this file since 49 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:
690 bytes
|
Line | |
---|
1 | #include "system.h" |
---|
2 | #include "timing.hpp" |
---|
3 | #include <stdio.h> |
---|
4 | #include <stdlib.h> |
---|
5 | #ifdef __MAC__ |
---|
6 | #include <Timer.h> |
---|
7 | #else |
---|
8 | #include <sys/time.h> |
---|
9 | #endif |
---|
10 | #include <unistd.h> |
---|
11 | |
---|
12 | void timer_init() { ; } |
---|
13 | void timer_uninit() { ; } |
---|
14 | |
---|
15 | |
---|
16 | double time_marker::diff_time(time_marker *other) |
---|
17 | { |
---|
18 | return ((double)(micro_seconds - other->micro_seconds))/1000000.0; |
---|
19 | } |
---|
20 | |
---|
21 | void time_marker::get_time() |
---|
22 | { |
---|
23 | UnsignedWide tm; |
---|
24 | |
---|
25 | Microseconds(&tm); |
---|
26 | micro_seconds = tm.lo; |
---|
27 | } |
---|
28 | |
---|
29 | time_marker::time_marker() { get_time(); } |
---|
30 | |
---|
31 | void milli_wait(unsigned wait_time) |
---|
32 | { |
---|
33 | UnsignedWide tim,tim2; |
---|
34 | |
---|
35 | Microseconds(&tim); |
---|
36 | Microseconds(&tim2); |
---|
37 | while ( (tim2.lo - tim.lo) < wait_time*1000) |
---|
38 | Microseconds(&tim2); |
---|
39 | // SystemTask(); |
---|
40 | } |
---|
41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.