source: abuse/tags/pd/macabuse/imlib/port/sgi/timing.c @ 49

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: 633 bytes
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include <sys/time.h>
4#include <unistd.h>
5#include "timing.hpp"
6
7void timer_init() { ; }
8void timer_uninit() { ; }
9
10double time_marker::diff_time(time_marker *other)
11
12  return (double)(seconds-other->seconds)+ 
13         (double)(micro_seconds-other->micro_seconds)/1000000;
14}
15
16
17void time_marker::get_time()
18{
19  struct timezone tz={0,DST_USA};     
20  gettimeofday((struct timeval *)&seconds,&tz);
21}
22
23time_marker::time_marker()
24{
25  struct timezone tz={0,DST_USA};     
26  gettimeofday((struct timeval *)&seconds,&tz);
27}
28
29void milli_wait(unsigned wait_time)
30{
31  sginap(wait_time*sysconf(3)/1000);
32}
33
Note: See TracBrowser for help on using the repository browser.