About 12,000 results
Open links in new tab
  1. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

  2. How do I get the current time in Python? - Stack Overflow

    559 How do I get the current time in Python? The time module The time module provides functions that tell us the time in "seconds since the epoch" as well as other utilities.

  3. Getting today's date in YYYY-MM-DD in Python? - Stack Overflow

    Try not to use python built in functions and variables as local variables (ex: today, year, day). Also, the request from the user is to get today's date in YYYY-MM-DD format.

  4. How do I get time of a Python program's execution?

    Oct 13, 2009 · To measure a Python program's execution time, use the time module. Record the start time with time .time () before the code and the end time after. Subtract start from end to …

  5. time - High-precision clock in Python - Stack Overflow

    The standard time.time() function provides sub-second precision, though that precision varies by platform. For Linux and Mac precision is +- 1 microsecond or 0.001 milliseconds. Python on …

  6. datetime - How to get UTC time in Python? - Stack Overflow

    Apr 11, 2013 · For Python 3, use datetime.now(timezone.utc) to get a timezone-aware datetime, and use .timestamp() to convert it to a timestamp.

  7. Get POSIX/Unix time in seconds and nanoseconds in Python?

    On Python 3, the time module gives you access to 5 different types of clock, each with different properties; some of these may offer you nanosecond precision timing.

  8. How to get current time in python and break up into year, month, …

    May 6, 2015 · I would like to get the current time in Python and assign them into variables like year, month, day, hour, minute. How can this be done in Python 2.7?

  9. How can I time a code segment for testing performance with …

    I've a python script which works just as it should, but I need to write the execution time. I've googled that I should use timeit but I can't seem to get it to work. My Python script looks like th...

  10. python - What is the standard way to add N seconds to …

    Sep 19, 2008 · You cannot simply add number to datetime because it's unclear what unit is used: seconds, hours, weeks... There is timedelta class for manipulations with date and time. …