Mercurial > hg > xemacs-beta
comparison lib-src/profile.c @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | c5d627a313b1 |
children | de805c49cfc1 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
30 ** 'q' -- exit. | 30 ** 'q' -- exit. |
31 ** | 31 ** |
32 ** abstraction : a stopwatch | 32 ** abstraction : a stopwatch |
33 ** operations: reset_watch, get_time | 33 ** operations: reset_watch, get_time |
34 */ | 34 */ |
35 #include <../src/config.h> | 35 #include <config.h> |
36 #include <stdio.h> | 36 #include <stdio.h> |
37 #include <stdlib.h> | 37 #include <stdlib.h> |
38 #include "../src/systime.h" | 38 #include "../src/systime.h" |
39 | 39 |
40 static struct timeval TV1, TV2; | 40 static struct timeval TV1, TV2; |
41 static int watch_not_started = 1; /* flag */ | 41 static int watch_not_started = 1; /* flag */ |
42 static char time_string[30]; | 42 static char time_string[30]; |
43 | |
44 #ifdef WINDOWSNT | |
45 #include <sys/timeb.h> | |
46 /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ | |
47 void | |
48 gettimeofday (struct timeval *tv, struct timezone *tz) | |
49 { | |
50 struct _timeb tb; | |
51 _ftime (&tb); | |
52 | |
53 tv->tv_sec = tb.time; | |
54 tv->tv_usec = tb.millitm * 1000L; | |
55 if (tz) | |
56 { | |
57 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ | |
58 tz->tz_dsttime = tb.dstflag; /* type of dst correction */ | |
59 } | |
60 } | |
61 #endif | |
43 | 62 |
44 /* Reset the stopwatch to zero. */ | 63 /* Reset the stopwatch to zero. */ |
45 | 64 |
46 static void | 65 static void |
47 reset_watch (void) | 66 reset_watch (void) |