summaryrefslogtreecommitdiff
path: root/lib-src/profile.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-11-10 22:26:57 +0000
committerRichard M. Stallman <rms@gnu.org>1994-11-10 22:26:57 +0000
commitc513860d1a0712dc74ade1170beb0bf7cf1e281e (patch)
treed0c2f65d389bf44a80f7ea92c61647bfb6d23757 /lib-src/profile.c
parent12b31d3af8cbef44bf4fa72942c680458ddcbffe (diff)
downloademacs-c513860d1a0712dc74ade1170beb0bf7cf1e281e.tar.gz
(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 @@
#include <../src/config.h>
#include <../src/systime.h>
-static struct timeval TV1, TV2;
+static EMACS_TIME TV1, TV2;
static int watch_not_started = 1; /* flag */
static char time_string[30];
@@ -56,13 +56,8 @@ get_time ()
if (watch_not_started)
exit (1); /* call reset_watch first ! */
EMACS_GET_TIME (TV2);
- if (TV1.tv_usec > TV2.tv_usec)
- {
- TV2.tv_usec += 1000000;
- TV2.tv_sec--;
- }
- sprintf (time_string, "%lu.%06lu",
- TV2.tv_sec - TV1.tv_sec, TV2.tv_usec - TV1.tv_usec);
+ EMACS_SUB_TIME (TV2, TV2, TV1);
+ sprintf (time_string, "%lu.%06lu", EMACS_SECS(TV2), EMACS_USECS(TV2));
return time_string;
}