Built-in Module time

time This module provides various time-related functions. It is always available. (On some systems, not all functions may exist; e.g. the ``milli'' variants can't always be implemented.)

An explanation of some terminology and conventions is in order.

Functions and data items are:


\begin{datadesc}{altzone}
The offset of the local DST timezone, in seconds west ...
..., if one is defined. Only use this if \code{daylight} is
nonzero.
\end{datadesc}


\begin{funcdesc}{asctime}{tuple}
Convert a tuple representing a time as returned...
...ke the C function of
the same name, there is no trailing newline.
\end{funcdesc}


\begin{funcdesc}{ctime}{secs}
Convert a time expressed in seconds since the epoc...
...e. \code{ctime(t)} is equivalent to
\code{asctime(localtime(t))}.
\end{funcdesc}


\begin{datadesc}{daylight}
Nonzero if a DST timezone is defined.
\end{datadesc}


\begin{funcdesc}{gmtime}{secs}
Convert a time expressed in seconds since the epo...
...gnored. Note subtle differences with the C function of this name.
\end{funcdesc}


\begin{funcdesc}{localtime}{secs}
Like \code{gmtime} but converts to local time. The dst flag is set
to 1 when DST applies to the given time.
\end{funcdesc}


\begin{funcdesc}{millisleep}{msecs}
Suspend execution for the given number of mi...
...you can now use use \code{sleep} with a floating point argument.)
\end{funcdesc}


\begin{funcdesc}{millitimer}{}
Return the number of milliseconds of real time el...
...g run). The return value
may be negative, and it may wrap around.
\end{funcdesc}


\begin{funcdesc}{mktime}{tuple}
This is the inverse function of \code{localtime}...
...ll 9-tuple (since the dst flag is needed). It returns an integer.
\end{funcdesc}


\begin{funcdesc}{sleep}{secs}
Suspend execution for the given number of seconds....
...be a floating point number to indicate a more precise sleep time.
\end{funcdesc}


\begin{funcdesc}{time}{}
Return the time as a floating point number expressed in...
...alternative for measuring precise
intervals is \code{millitimer}.
\end{funcdesc}


\begin{datadesc}{timezone}
The offset of the local (non-DST) timezone, in second...
...e in most of Western Europe, positive in the US,
zero in the UK).
\end{datadesc}


\begin{datadesc}{tzname}
A tuple of two strings: the first is the name of the lo...
...no DST
timezone is defined, the second string should not be used.
\end{datadesc}