Python3 time. time () method, python3time. time

Source: Internet
Author: User

Python3 time. time () method, python3time. time

The time () returned by the Python time () method indicates the time floating point in seconds.

Note: even if the time is always returned as a floating point number, not all systems provide better precision when the time is less than 1 second. Although this function usually returns a non-decreasing value, it can return a smaller value between two calls after the system clock has returned.

Python3 time. time () syntax

The syntax of the time () method is as follows:

time.time()

 

Python3 time. time () parameter
  • NA

 

Python3 time. time () Return Value

The time returned by this method, because the Floating Point Number of the second is represented since the New Era (in UTC.

 

Python3 time. time () instance

The following example shows how to use the time () method.

#!/usr/bin/python3import 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(): 1455519806.011433 time.struct_time(tm_year=2016, tm_mon=2, tm_mday=15, tm_hour=12, tm_min=33, tm_sec=26, tm_wday=0, tm_yday=46, tm_isdst=0)Mon Feb 15 12:33:26 2016

 

Address: http://www.manongjc.com/article/664.html

Read more:

Python3 time. strftime () method

Python3 time. sleep () method

Python3 time. mktime () method

Python3 time. localtime () method

Python3 time. gmtime () method

Python3 time. ctime () method

Python3 time. clock () method

Python3 time. asctime () method

Python3 time. altzone () method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.