Keeping Track of Elapsed time in Python

Source: Internet
Author: User
Tags python script

Refer to:http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/


This is article shows how to put a few lines of Python code into your Python script I can tell how long script has B Een running, or how long a certain part of the task took to run.

The Quick Answer: For the most accurrate time elapsed, use the time module and make 2 Time.time () objects. The difference between these objects are the time elapsed. Don't use Time.clock (). The Whole Story

Its pretty basic:i have certain parts of a large Python script (which is happen to access a MySQL database) that I would like To keep track the How long it took them to execute. wrong Answers

Initially, I read on a Pleac-python article, dates and times (which really are a great overview of Python ' s time m  Odule), about some ways to use Python ' s time module. That article suggests, all of you, need to does is:?

1 2 3 4 5 6 7 8 9 10
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.