larytet / larytet-master

Automatically exported from code.google.com/p/larytet-master
0 stars 1 forks source link

DateTime.Now and DateTime.UtcNow #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Two methods have different performance according to
http://www.codeproject.com/KB/cs/DateTimePrecise.aspx?msg=2761979

Stopwatch.GetTimestamp()    0.000000184
DateTime.Now    0.000000226
DateTime.UtcNow     0.000000010
DateTime.UtcNow.ToLocalTime()   0.000000221
DateTimePrecise.Now     0.000000482
DateTimePrecise.UtcNow  0.000000248
DateTimePrecise.UtcNow.ToLocalTime()    0.000000455

226 micro for DateTime.Now and 10micro for DateTime.UtcNow
The difference between two is local time. Should be tested in Linux

Original issue reported on code.google.com by larytet@gmail.com on 4 Dec 2009 at 10:01