diff options
| author | Paul Eggert | 2012-06-22 14:17:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-06-22 14:17:42 -0700 |
| commit | d35af63cd671563fd188c3b0a1ef30067027c7aa (patch) | |
| tree | c9e01847ccf788e23794684da9331c3e0defd0d3 /doc | |
| parent | f143bfe38b43ad0a9d817f05c25e418982dca06f (diff) | |
| download | emacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.tar.gz emacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.zip | |
Support higher-resolution time stamps.
Fixes: debbugs:9000
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 48 | ||||
| -rw-r--r-- | doc/lispref/processes.texi | 6 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-06-21 Glenn Morris <rgm@gnu.org> | 8 | 2012-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. | |||
| 1166 | zone. | 1166 | zone. |
| 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 |
| 1170 | integers, @code{(@var{sec-high} @var{sec-low} @var{microsec} | ||
| 1171 | @var{picosec})}, or of three | ||
| 1170 | integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of | 1172 | integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of |
| 1171 | two integers, @code{(@var{sec-high} @var{sec-low})}. The integers | 1173 | two 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 | |||
| 1181 | UTC) to the specified time. The third list element @var{microsec}, if | 1183 | UTC) to the specified time. The third list element @var{microsec}, if |
| 1182 | present, gives the number of microseconds from the start of that | 1184 | present, gives the number of microseconds from the start of that |
| 1183 | second to the specified time. | 1185 | second to the specified time. |
| 1186 | Similarly, the fourth list element @var{picosec}, if present, gives | ||
| 1187 | the number of picoseconds from the start of that microsecond to the | ||
| 1188 | specified 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 |
| 1186 | integers, while the timestamps in the return value of | 1191 | integers, 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 |
| 1188 | file-attributes}). In function arguments, e.g.@: the @var{time-value} | 1193 | file-attributes}). In function arguments, e.g.@: the @var{time-value} |
| 1189 | argument to @code{current-time-string}, both two- and three-integer | 1194 | argument to @code{current-time-string}, two-, three-, and four-integer |
| 1190 | lists are accepted. You can convert times from the list | 1195 | lists are accepted. You can convert times from the list |
| 1191 | representation into standard human-readable strings using | 1196 | representation 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 |
| 1219 | This function returns the current time, represented as a list of three | 1224 | This function returns the current time, represented as a list of four |
| 1220 | integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On | 1225 | integers @code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})}. |
| 1221 | systems with only one-second time resolutions, @var{microsec} is 0. | 1226 | These integers have trailing zeros on systems that return time with |
| 1227 | lower resolutions. On all current machines @var{picosec} is a | ||
| 1228 | multiple of 1000, but this may change as higher-resolution clocks | ||
| 1229 | become 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, |
| 1263 | as explained in the previous section) into calendrical information and | 1271 | as explained in the previous section) into calendrical information and |
| 1264 | vice versa. | 1272 | vice versa. |
| 1265 | 1273 | ||
| @@ -1410,8 +1418,6 @@ This stands for a newline. | |||
| 1410 | This stands for the nanoseconds (000000000-999999999). To ask for | 1418 | This stands for the nanoseconds (000000000-999999999). To ask for |
| 1411 | fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for | 1419 | fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for |
| 1412 | microseconds, etc. Any excess digits are discarded, without rounding. | 1420 | microseconds, etc. Any excess digits are discarded, without rounding. |
| 1413 | Currently Emacs time stamps are at best microsecond resolution so the | ||
| 1414 | last three digits generated by plain @samp{%N} are always zero. | ||
| 1415 | @item %p | 1421 | @item %p |
| 1416 | This stands for @samp{AM} or @samp{PM}, as appropriate. | 1422 | This 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 |
| 1565 | This function returns the processor run time used by Emacs as a list | 1571 | This function returns the processor run time used by Emacs as a list |
| 1566 | of three integers: @code{(@var{high} @var{low} @var{microsec})}. The | 1572 | of four integers: @code{(@var{high} @var{low} @var{microsec} |
| 1567 | integers @var{high} and @var{low} combine to give the number of | 1573 | @var{picosec})}, using the same format as @code{current-time} |
| 1568 | seconds, 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 | |||
| 1576 | The third element, @var{microsec}, gives the microseconds (or 0 for | ||
| 1577 | systems that return time with the resolution of only one second). | ||
| 1578 | 1575 | ||
| 1579 | Note that the time returned by this function excludes the time Emacs | 1576 | Note that the time returned by this function excludes the time Emacs |
| 1580 | was not using the processor, and if the Emacs process has several | 1577 | was 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 |
| 1819 | If Emacs is idle, this function returns the length of time Emacs has | 1816 | If Emacs is idle, this function returns the length of time Emacs has |
| 1820 | been idle, as a list of three integers: @code{(@var{sec-high} | 1817 | been 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 |
| 1822 | high and low bits for the number of seconds and @var{microsec} is the | 1819 | @code{current-time} (@pxref{Time of Day}). |
| 1823 | additional number of microseconds (@pxref{Time of Day}). | ||
| 1824 | 1820 | ||
| 1825 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | 1821 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. |
| 1826 | This is a convenient way to test whether Emacs is idle. | 1822 | This 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 |
| 1771 | Time spent by the process in the user context, for running the | 1771 | Time spent by the process in the user context, for running the |
| 1772 | application's code. The corresponding @var{value} is in the | 1772 | application'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 |
| 1774 | format used by functions @code{current-time} (@pxref{Time of Day, | 1774 | format used by functions @code{current-time} (@pxref{Time of Day, |
| 1775 | current-time}) and @code{file-attributes} (@pxref{File Attributes}). | 1775 | current-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 |
| 1803 | The time when the process was started, in the same | 1803 | The 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 |
| 1808 | The time elapsed since the process started, in the @w{@code{(@var{high} | 1808 | The 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 |
| 1812 | The virtual memory size of the process, measured in kilobytes. | 1812 | The virtual memory size of the process, measured in kilobytes. |