[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 8e2b2a2: Minor cleanup in pdumper.c
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master 8e2b2a2: Minor cleanup in pdumper.c |
Date: |
Sat, 19 Jan 2019 13:23:00 -0500 (EST) |
branch: master
commit 8e2b2a2b179c3ed170ad9de32a320e788c6a3a5e
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Minor cleanup in pdumper.c
* src/pdumper (subtract_timespec): Function removed.
(pdumper_load): Use timespec_sub instead of subtract_timespec.
---
src/pdumper.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/pdumper.c b/src/pdumper.c
index b51a379..1c49167 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5388,15 +5388,6 @@ enum dump_section
NUMBER_DUMP_SECTIONS,
};
-/* Subtract two timespecs, yielding a difference in milliseconds. */
-static double
-subtract_timespec (struct timespec minuend, struct timespec subtrahend)
-{
- return
- 1000.0 * (double)(minuend.tv_sec - subtrahend.tv_sec)
- + (double)(minuend.tv_nsec - subtrahend.tv_nsec) / 1.0e6;
-}
-
/* Load a dump from DUMP_FILENAME. Return an error code.
N.B. We run very early in initialization, so we can't use lisp,
@@ -5552,8 +5543,11 @@ pdumper_load (const char *dump_filename)
dump_hooks[i] ();
initialized = true;
- dump_private.load_time = subtract_timespec (
- current_timespec (), start_time);
+ struct timespec load_timespec =
+ timespec_sub (current_timespec (), start_time);
+ dump_private.load_time =
+ (double) load_timespec.tv_sec * 1000.0
+ + (double) load_timespec.tv_nsec * 0.000001;
dump_private.dump_filename = dump_filename_copy;
dump_filename_copy = NULL;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 8e2b2a2: Minor cleanup in pdumper.c,
Eli Zaretskii <=