Quantcast
Viewing latest article 19
Browse Latest Browse All 22

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

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 latest article 19
Browse Latest Browse All 22

Trending Articles



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