Quantcast
Channel: User motagirl2 - Stack Overflow
Viewing all articles
Browse latest Browse all 22

Answer by motagirl2 for How do I get the current time in Python?

$
0
0

If you just want the current timestamp in ms (for example, to measure execution time), you can also use the "timeit" module:

import timeitstart_time = timeit.default_timer()do_stuff_you_want_to_measure()end_time = timeit.default_timer()print("Elapsed time: {}".format(end_time - start_time))

Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>