palau
(Pedro Enrique Palau)
March 24, 2021, 4:25pm
1
Hello.
We have a test where we call time.Now
twice. On Windows it fails because it returns the same time. In other systems it works fine.
I have looked for information on how to solve this problem and how to get a unique time but without good results.
Do you have an idea how to achieve this?
NobbZ
(Norbert Melzer)
March 24, 2021, 6:36pm
2
Wait longer between those snapshots.
Windows does clock has only a millisecond resolution if I recall correctly.
skillian
(Sean Killian)
March 26, 2021, 1:04am
3
skillian
(Sean Killian)
March 26, 2021, 1:06am
4
What does your test do that requires the times be different? Could you check if you’re on windows and sleep for 1ms to make sure your second call to time.Now gets a new time?
system
(system)
Closed
June 24, 2021, 1:06am
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.