aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-25 23:21:24 +0000
committerRichard M. Stallman1994-07-25 23:21:24 +0000
commit72ddb82c4952d98d25ef75dd1d38da3fe82bbb61 (patch)
tree3ddfddbe9ad44b3dd48cc14fa664313d93274c52
parent860befc8a298f7bc87b141e90faddb3a144123d4 (diff)
downloademacs-72ddb82c4952d98d25ef75dd1d38da3fe82bbb61.tar.gz
emacs-72ddb82c4952d98d25ef75dd1d38da3fe82bbb61.zip
(reset_watch, get_time): Use EMACS_GET_TIME.
(tzp): Var deleted.
-rw-r--r--lib-src/profile.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib-src/profile.c b/lib-src/profile.c
index 523659c5586..16a74b71351 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -34,24 +34,15 @@
34#include <../src/systime.h> 34#include <../src/systime.h>
35 35
36static struct timeval TV1, TV2; 36static struct timeval TV1, TV2;
37static struct timezone *tzp = (struct timezone *) NULL; /* no need timezone */
38static int watch_not_started = 1; /* flag */ 37static int watch_not_started = 1; /* flag */
39static char time_string[30]; 38static char time_string[30];
40 39
41#ifndef HAVE_GETTIMEOFDAY
42gettimeofday ()
43{
44 fprintf (stderr, "profile: this system does not support gettimeofday\n");
45 exit (1);
46}
47#endif
48
49/* Reset the stopwatch to zero. */ 40/* Reset the stopwatch to zero. */
50 41
51int 42int
52reset_watch () 43reset_watch ()
53{ 44{
54 gettimeofday (&TV1, tzp); 45 EMACS_GET_TIME (TV1);
55 watch_not_started = 0; 46 watch_not_started = 0;
56} 47}
57 48
@@ -64,7 +55,7 @@ get_time ()
64{ 55{
65 if (watch_not_started) 56 if (watch_not_started)
66 exit (1); /* call reset_watch first ! */ 57 exit (1); /* call reset_watch first ! */
67 gettimeofday (&TV2, tzp); 58 EMACS_GET_TIME (TV2);
68 if (TV1.tv_usec > TV2.tv_usec) 59 if (TV1.tv_usec > TV2.tv_usec)
69 { 60 {
70 TV2.tv_usec += 1000000; 61 TV2.tv_usec += 1000000;