aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/profile.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-10 22:26:57 +0000
committerRichard M. Stallman1994-11-10 22:26:57 +0000
commitdb965a28af038ec577f26288c86a6366e5fddd2e (patch)
treeb787eae823bd5a37e623bfabb1785fe25e5034b1 /lib-src/profile.c
parentde98fcafe2c3a26e11aa3febfcbe73591d912406 (diff)
downloademacs-db965a28af038ec577f26288c86a6366e5fddd2e.tar.gz
emacs-db965a28af038ec577f26288c86a6366e5fddd2e.zip
(TV1, TV2): Use EMACS_TIME as type.
(get_time): Use EMACS_SUB_TIME.
Diffstat (limited to 'lib-src/profile.c')
-rw-r--r--lib-src/profile.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib-src/profile.c b/lib-src/profile.c
index 09b094ce934..d9585f3af87 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -33,7 +33,7 @@
33#include <../src/config.h> 33#include <../src/config.h>
34#include <../src/systime.h> 34#include <../src/systime.h>
35 35
36static struct timeval TV1, TV2; 36static EMACS_TIME TV1, TV2;
37static int watch_not_started = 1; /* flag */ 37static int watch_not_started = 1; /* flag */
38static char time_string[30]; 38static char time_string[30];
39 39
@@ -56,13 +56,8 @@ get_time ()
56 if (watch_not_started) 56 if (watch_not_started)
57 exit (1); /* call reset_watch first ! */ 57 exit (1); /* call reset_watch first ! */
58 EMACS_GET_TIME (TV2); 58 EMACS_GET_TIME (TV2);
59 if (TV1.tv_usec > TV2.tv_usec) 59 EMACS_SUB_TIME (TV2, TV2, TV1);
60 { 60 sprintf (time_string, "%lu.%06lu", EMACS_SECS(TV2), EMACS_USECS(TV2));
61 TV2.tv_usec += 1000000;
62 TV2.tv_sec--;
63 }
64 sprintf (time_string, "%lu.%06lu",
65 TV2.tv_sec - TV1.tv_sec, TV2.tv_usec - TV1.tv_usec);
66 return time_string; 61 return time_string;
67} 62}
68 63