unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* nanosecond-resolution time stamps
@ 2011-07-01  6:59 Paul Eggert
  2011-07-01  8:14 ` [PATCH 1/7] gnulib substrate for ns-resolution " Paul Eggert
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Paul Eggert @ 2011-07-01  6:59 UTC (permalink / raw)
  To: Emacs Development

Emacs currently uses microsecond-resolution time stamps internally,
whereas GNU and similar operating systems have all gone to
nanosecond-resolution time stamps internally.  This mismatch leads to
problems, for example, Emacs mishandles file time stamps when it
copies them.  I have prepared a set of patches to fix this, and would
like them to be considered for Emacs 24 if possible or for a later
version if not.  I'll send them in other email messages shortly.

The basic idea of these patches is to add 3 digits to the time stamp
format.  For example, currently (current-time) might return
(19981 28208 421496); with the patches, it returns
(19981 28208 421496053) at exactly the same instant.  That is, the
last number of the Emacs internal time stamp now counts nanoseconds,
not microseconds.  (On older machines that do not support finegrained
time stamps the trailing digits are always 000.)

If we're on a 32-bit machine and the nanosecond count exceeds 2**29,
Emacs falls back on floating point to represent the out-of-range
integer.  (There is a similar problem, by the way, with the *first*
number being out of range for integers, on some platforms, and the
patches use the same solution there.)

This change to the internal time stamp format is an incompatible
change and might cause problems with external packages.  If you like,
it'd be easy to alter to the patch to use any other reasonable format.
For example, if you'd prefer the format (19981 28208 421496 053)
(i.e., the sub-microsecond count is appended), I could easily do that.
But I thought I'd get my current code out the door, for review.

(I'm sending this first message now, just a few nanoseconds before
June ends, since that's the cutoff for Emacs 24 changes....)



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-07-05  7:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01  6:59 nanosecond-resolution time stamps Paul Eggert
2011-07-01  8:14 ` [PATCH 1/7] gnulib substrate for ns-resolution " Paul Eggert
2011-07-01 11:20   ` Eli Zaretskii
2011-07-01 14:13     ` Eli Zaretskii
2011-07-01 16:27     ` Paul Eggert
2011-07-01 17:39       ` Eli Zaretskii
2011-07-01 18:50       ` Paul Eggert
2011-07-01 19:52         ` Eli Zaretskii
2011-07-01  8:14 ` [PATCH 2/7] etc/NEWS patch " Paul Eggert
2011-07-01  8:15 ` [PATCH 3/7] Doc patches " Paul Eggert
2011-07-01  8:15 ` [PATCH 4/7] configure-time support " Paul Eggert
2011-07-01  8:15 ` [PATCH 5/7] C-level " Paul Eggert
2011-07-01  8:16 ` [PATCH 6/7] lib-src " Paul Eggert
2011-07-01  8:16 ` [PATCH 7/7] Lisp-level " Paul Eggert
2011-07-01 15:55 ` nanosecond-resolution " Stefan Monnier
2011-07-01 17:15   ` Paul Eggert
2011-07-04 15:04     ` Stefan Monnier
2011-07-05  7:13       ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).