aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2012-06-22 14:17:42 -0700
committerPaul Eggert2012-06-22 14:17:42 -0700
commitd35af63cd671563fd188c3b0a1ef30067027c7aa (patch)
treec9e01847ccf788e23794684da9331c3e0defd0d3 /doc
parentf143bfe38b43ad0a9d817f05c25e418982dca06f (diff)
downloademacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.tar.gz
emacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.zip
Support higher-resolution time stamps.
Fixes: debbugs:9000
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/os.texi48
-rw-r--r--doc/lispref/processes.texi6
3 files changed, 32 insertions, 29 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 91c3617cff8..838617cf866 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 Support higher-resolution time stamps (Bug#9000).
4 * os.texi (Time of Day, Time Parsing, Processor Run Time, Idle Timers):
5 * processes.texi (System Processes):
6 Time stamp resolution is now picosecond, not microsecond.
7
12012-06-21 Glenn Morris <rgm@gnu.org> 82012-06-21 Glenn Morris <rgm@gnu.org>
2 9
3 * Makefile.in: Rename infodir to buildinfodir throughout. (Bug#11737) 10 * Makefile.in: Rename infodir to buildinfodir throughout. (Bug#11737)
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index e604d92e690..6431ac8bead 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1166,7 +1166,9 @@ The value may be a floating point number.
1166zone. 1166zone.
1167 1167
1168@cindex epoch 1168@cindex epoch
1169 Most of these functions represent time as a list of either three 1169 Most of these functions represent time as a list of either four
1170integers, @code{(@var{sec-high} @var{sec-low} @var{microsec}
1171@var{picosec})}, or of three
1170integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of 1172integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of
1171two integers, @code{(@var{sec-high} @var{sec-low})}. The integers 1173two integers, @code{(@var{sec-high} @var{sec-low})}. The integers
1172@var{sec-high} and @var{sec-low} give the high and low bits of an 1174@var{sec-high} and @var{sec-low} give the high and low bits of an
@@ -1181,12 +1183,15 @@ is the number of seconds from the @dfn{epoch} (0:00 January 1, 1970
1181UTC) to the specified time. The third list element @var{microsec}, if 1183UTC) to the specified time. The third list element @var{microsec}, if
1182present, gives the number of microseconds from the start of that 1184present, gives the number of microseconds from the start of that
1183second to the specified time. 1185second to the specified time.
1186Similarly, the fourth list element @var{picosec}, if present, gives
1187the number of picoseconds from the start of that microsecond to the
1188specified time.
1184 1189
1185 The return value of @code{current-time} represents time using three 1190 The return value of @code{current-time} represents time using three
1186integers, while the timestamps in the return value of 1191integers, as do the timestamps in the return value of
1187@code{file-attributes} use two integers (@pxref{Definition of 1192@code{file-attributes} (@pxref{Definition of
1188file-attributes}). In function arguments, e.g.@: the @var{time-value} 1193file-attributes}). In function arguments, e.g.@: the @var{time-value}
1189argument to @code{current-time-string}, both two- and three-integer 1194argument to @code{current-time-string}, two-, three-, and four-integer
1190lists are accepted. You can convert times from the list 1195lists are accepted. You can convert times from the list
1191representation into standard human-readable strings using 1196representation into standard human-readable strings using
1192@code{current-time}, or to other forms using the @code{decode-time} 1197@code{current-time}, or to other forms using the @code{decode-time}
@@ -1216,9 +1221,12 @@ The argument @var{time-value}, if given, specifies a time to format
1216@end defun 1221@end defun
1217 1222
1218@defun current-time 1223@defun current-time
1219This function returns the current time, represented as a list of three 1224This function returns the current time, represented as a list of four
1220integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On 1225integers @code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})}.
1221systems with only one-second time resolutions, @var{microsec} is 0. 1226These integers have trailing zeros on systems that return time with
1227lower resolutions. On all current machines @var{picosec} is a
1228multiple of 1000, but this may change as higher-resolution clocks
1229become available.
1222@end defun 1230@end defun
1223 1231
1224@defun float-time &optional time-value 1232@defun float-time &optional time-value
@@ -1259,7 +1267,7 @@ time zone.
1259@node Time Conversion 1267@node Time Conversion
1260@section Time Conversion 1268@section Time Conversion
1261 1269
1262 These functions convert time values (lists of two or three integers, 1270 These functions convert time values (lists of two to four integers,
1263as explained in the previous section) into calendrical information and 1271as explained in the previous section) into calendrical information and
1264vice versa. 1272vice versa.
1265 1273
@@ -1410,8 +1418,6 @@ This stands for a newline.
1410This stands for the nanoseconds (000000000-999999999). To ask for 1418This stands for the nanoseconds (000000000-999999999). To ask for
1411fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for 1419fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for
1412microseconds, etc. Any excess digits are discarded, without rounding. 1420microseconds, etc. Any excess digits are discarded, without rounding.
1413Currently Emacs time stamps are at best microsecond resolution so the
1414last three digits generated by plain @samp{%N} are always zero.
1415@item %p 1421@item %p
1416This stands for @samp{AM} or @samp{PM}, as appropriate. 1422This stands for @samp{AM} or @samp{PM}, as appropriate.
1417@item %r 1423@item %r
@@ -1563,18 +1569,9 @@ When called interactively, it prints the uptime in the echo area.
1563 1569
1564@defun get-internal-run-time 1570@defun get-internal-run-time
1565This function returns the processor run time used by Emacs as a list 1571This function returns the processor run time used by Emacs as a list
1566of three integers: @code{(@var{high} @var{low} @var{microsec})}. The 1572of four integers: @code{(@var{high} @var{low} @var{microsec}
1567integers @var{high} and @var{low} combine to give the number of 1573@var{picosec})}, using the same format as @code{current-time}
1568seconds, which is 1574(@pxref{Time of Day}).
1569@ifnottex
1570@var{high} * 2**16 + @var{low}.
1571@end ifnottex
1572@tex
1573$high*2^{16}+low$.
1574@end tex
1575
1576The third element, @var{microsec}, gives the microseconds (or 0 for
1577systems that return time with the resolution of only one second).
1578 1575
1579Note that the time returned by this function excludes the time Emacs 1576Note that the time returned by this function excludes the time Emacs
1580was not using the processor, and if the Emacs process has several 1577was not using the processor, and if the Emacs process has several
@@ -1817,10 +1814,9 @@ set up to repeat will subsequently run another time, one by one.
1817 1814
1818@defun current-idle-time 1815@defun current-idle-time
1819If Emacs is idle, this function returns the length of time Emacs has 1816If Emacs is idle, this function returns the length of time Emacs has
1820been idle, as a list of three integers: @code{(@var{sec-high} 1817been idle, as a list of four integers: @code{(@var{sec-high}
1821@var{sec-low} @var{microsec})}, where @var{high} and @var{low} are the 1818@var{sec-low} @var{microsec} @var{picosec})}, using the same format as
1822high and low bits for the number of seconds and @var{microsec} is the 1819@code{current-time} (@pxref{Time of Day}).
1823additional number of microseconds (@pxref{Time of Day}).
1824 1820
1825When Emacs is not idle, @code{current-idle-time} returns @code{nil}. 1821When Emacs is not idle, @code{current-idle-time} returns @code{nil}.
1826This is a convenient way to test whether Emacs is idle. 1822This is a convenient way to test whether Emacs is idle.
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 34b62a48329..d1bfa0e936d 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1770,7 +1770,7 @@ faults for all the child processes of the given process.
1770@item utime 1770@item utime
1771Time spent by the process in the user context, for running the 1771Time spent by the process in the user context, for running the
1772application's code. The corresponding @var{value} is in the 1772application's code. The corresponding @var{value} is in the
1773@w{@code{(@var{high} @var{low} @var{microsec})}} format, the same 1773@w{@code{(@var{high} @var{low} @var{microsec} @var{picosec})}} format, the same
1774format used by functions @code{current-time} (@pxref{Time of Day, 1774format used by functions @code{current-time} (@pxref{Time of Day,
1775current-time}) and @code{file-attributes} (@pxref{File Attributes}). 1775current-time}) and @code{file-attributes} (@pxref{File Attributes}).
1776 1776
@@ -1801,12 +1801,12 @@ The number of threads in the process.
1801 1801
1802@item start 1802@item start
1803The time when the process was started, in the same 1803The time when the process was started, in the same
1804@w{@code{(@var{high} @var{low} @var{microsec})}} format used by 1804@w{@code{(@var{high} @var{low} @var{microsec} @var{picosec})}} format used by
1805@code{current-time} and by @code{file-attributes}. 1805@code{current-time} and by @code{file-attributes}.
1806 1806
1807@item etime 1807@item etime
1808The time elapsed since the process started, in the @w{@code{(@var{high} 1808The time elapsed since the process started, in the @w{@code{(@var{high}
1809@var{low} @var{microsec})}} format. 1809@var{low} @var{microsec} @var{picosec})}} format.
1810 1810
1811@item vsize 1811@item vsize
1812The virtual memory size of the process, measured in kilobytes. 1812The virtual memory size of the process, measured in kilobytes.