Yaman Yaman - 1 year ago 95
C# Question

DateTime.Now retrieval speed

Is there any chance that this statement would return true

DateTime.Now == DateTime.Now

can a very fast machine return true for this statement, I tried on several machines and its always false ?

Answer Source


The resolution of this property depends on the system timer, which is approximately 15 milliseconds on Windows systems.As a result, repeated calls to the Now property in a short time interval, such as in a loop, may return the same value.

source: https://msdn.microsoft.com/en-us/library/system.datetime.now(v=vs.110).aspx

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download