emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 3e12551: pdumper-stats now returns s, not ms


From: Paul Eggert
Subject: [Emacs-diffs] master 3e12551: pdumper-stats now returns s, not ms
Date: Sat, 19 Jan 2019 17:39:22 -0500 (EST)

branch: master
commit 3e1255172334f3c0645d37eb92c05a628fa3d548
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    pdumper-stats now returns s, not ms
    
    * doc/lispref/internals.texi (pdumper-stats):
    * src/pdumper.c (pdumper_load): Return seconds, not milliseconds.
    Minimize rounding errors in the usual case.
---
 doc/lispref/internals.texi | 2 +-
 src/pdumper.c              | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 437657f..06ff9f7 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -232,7 +232,7 @@ time it took to restore the Emacs state.  The value is an 
alist
 @address@hidden((dumped-with-pdumper . t) (load-time . @var{time})
 (dump-file-name . @var{file}))}},
 where @var{file} is the name of the dump file, and @var{time} is the
-time in milliseconds it took to restore the state from the dump file.
+time in seconds it took to restore the state from the dump file.
 If the current session was not restored from a portable dump file, the
 value is nil.
 @end defun
diff --git a/src/pdumper.c b/src/pdumper.c
index 19a2132..4bbeabb 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5545,9 +5545,10 @@ pdumper_load (const char *dump_filename)
 
   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;
+  ALLOW_IMPLICIT_CONVERSION;
+  double s = load_timespec.tv_sec, ns = load_timespec.tv_nsec;
+  DISALLOW_IMPLICIT_CONVERSION;
+  dump_private.load_time = (s * 1e9 + ns) / 1e9;
   dump_private.dump_filename = dump_filename_copy;
   dump_filename_copy = NULL;
 
@@ -5569,7 +5570,7 @@ the return value is an alist of the form:
 
   ((dumped-with-pdumper . t) (load-time . TIME) (dump-file-name . FILE))
 
-where TIME is the time in milliseconds it took to restore Emacs state
+where TIME is the time in seconds it took to restore Emacs state
 from the dump file, and FILE is the name of the dump file.
 Value is nil if this session was not started using a portable dump file.*/)
      (void)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]