For more information about how to use the time () method in Python, see pythontime.
The return time of the time () method, expressed in seconds in UTC time.
Note: although it is always returned as a floating point number in time, not all systems provide a precision of over 1 second. Although this function normally returns a non-decreasing value, it can return a lower value than the previous call when the system clock has returned two calls.
Syntax
The syntax of the time () method is as follows:
Parameters
Return Value
The time returned by this method, because the time in seconds represents a floating point (in UTC ).
Example
The following example shows how to use the time () method.
#! /Usr/bin/pythonimport timeprint "time. time (): % f "% time. time () print time. localtime (time. time () print time. asctime (time. localtime (time. time ()))
When we run the above program, it will produce the following results:
Time. time (): 1234892919.655932 (2014, 2, 17, 10, 28, 39, 1, 48, 0) Tue Feb 17 10:28:39 2014