0

I have the following piece of code

import time
time.strftime("%Y%m%d%H%M%S")

As you see the above will only print at the second level at most. So if I call this function twice within the same second then it will print the same value.

To have a further level of granularity how do I call the millisecond clock that runs within a particular second so that few milliseconds have passed by the time I call this function again and so I get a new value at the second call

London guy
  • 27,522
  • 44
  • 121
  • 179
  • Why don't you just use the POSIX time instead? – idjaw Jun 16 '17 at 14:13
  • You can use [`datetime.strftime`’s `%f`](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior) to get *microseconds*, if those are acceptable. – Ry- Jun 16 '17 at 14:14

0 Answers0