aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-01-19 14:38:52 -0800
committerPaul Eggert2019-01-19 14:39:16 -0800
commit3e1255172334f3c0645d37eb92c05a628fa3d548 (patch)
tree4c62eb68bff62b5e6a23b9e5d5ea5347db593eef
parentb821a70cb9467186afb55734a0e5cb4601909916 (diff)
downloademacs-3e1255172334f3c0645d37eb92c05a628fa3d548.tar.gz
emacs-3e1255172334f3c0645d37eb92c05a628fa3d548.zip
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.
-rw-r--r--doc/lispref/internals.texi2
-rw-r--r--src/pdumper.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 437657f2438..06ff9f70bf9 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
232@w{@code{((dumped-with-pdumper . t) (load-time . @var{time}) 232@w{@code{((dumped-with-pdumper . t) (load-time . @var{time})
233(dump-file-name . @var{file}))}}, 233(dump-file-name . @var{file}))}},
234where @var{file} is the name of the dump file, and @var{time} is the 234where @var{file} is the name of the dump file, and @var{time} is the
235time in milliseconds it took to restore the state from the dump file. 235time in seconds it took to restore the state from the dump file.
236If the current session was not restored from a portable dump file, the 236If the current session was not restored from a portable dump file, the
237value is nil. 237value is nil.
238@end defun 238@end defun
diff --git a/src/pdumper.c b/src/pdumper.c
index 19a21329b1e..4bbeabb828e 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5545,9 +5545,10 @@ pdumper_load (const char *dump_filename)
5545 5545
5546 struct timespec load_timespec = 5546 struct timespec load_timespec =
5547 timespec_sub (current_timespec (), start_time); 5547 timespec_sub (current_timespec (), start_time);
5548 dump_private.load_time = 5548 ALLOW_IMPLICIT_CONVERSION;
5549 (double) load_timespec.tv_sec * 1000.0 5549 double s = load_timespec.tv_sec, ns = load_timespec.tv_nsec;
5550 + (double) load_timespec.tv_nsec * 0.000001; 5550 DISALLOW_IMPLICIT_CONVERSION;
5551 dump_private.load_time = (s * 1e9 + ns) / 1e9;
5551 dump_private.dump_filename = dump_filename_copy; 5552 dump_private.dump_filename = dump_filename_copy;
5552 dump_filename_copy = NULL; 5553 dump_filename_copy = NULL;
5553 5554
@@ -5569,7 +5570,7 @@ the return value is an alist of the form:
5569 5570
5570 ((dumped-with-pdumper . t) (load-time . TIME) (dump-file-name . FILE)) 5571 ((dumped-with-pdumper . t) (load-time . TIME) (dump-file-name . FILE))
5571 5572
5572where TIME is the time in milliseconds it took to restore Emacs state 5573where TIME is the time in seconds it took to restore Emacs state
5573from the dump file, and FILE is the name of the dump file. 5574from the dump file, and FILE is the name of the dump file.
5574Value is nil if this session was not started using a portable dump file.*/) 5575Value is nil if this session was not started using a portable dump file.*/)
5575 (void) 5576 (void)