diff options
| author | Paul Eggert | 2019-01-19 14:38:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-01-19 14:39:16 -0800 |
| commit | 3e1255172334f3c0645d37eb92c05a628fa3d548 (patch) | |
| tree | 4c62eb68bff62b5e6a23b9e5d5ea5347db593eef | |
| parent | b821a70cb9467186afb55734a0e5cb4601909916 (diff) | |
| download | emacs-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.texi | 2 | ||||
| -rw-r--r-- | src/pdumper.c | 9 |
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}))}}, |
| 234 | where @var{file} is the name of the dump file, and @var{time} is the | 234 | where @var{file} is the name of the dump file, and @var{time} is the |
| 235 | time in milliseconds it took to restore the state from the dump file. | 235 | time in seconds it took to restore the state from the dump file. |
| 236 | If the current session was not restored from a portable dump file, the | 236 | If the current session was not restored from a portable dump file, the |
| 237 | value is nil. | 237 | value 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 | ||
| 5572 | where TIME is the time in milliseconds it took to restore Emacs state | 5573 | where TIME is the time in seconds it took to restore Emacs state |
| 5573 | from the dump file, and FILE is the name of the dump file. | 5574 | from the dump file, and FILE is the name of the dump file. |
| 5574 | Value is nil if this session was not started using a portable dump file.*/) | 5575 | Value is nil if this session was not started using a portable dump file.*/) |
| 5575 | (void) | 5576 | (void) |