datetime.utcnow 40x faster than datetime.now
Posted by noah on May 21, 2008
DateTime.UtcNow is over 40x faster than DateTime.Now in c#.
DateTime.UtcNow.AddHours(-5) is 20x faster than DateTime.Now. this doesn’t work in practice because you have to account for daylight savings time… and there’s no fast built-in way to do it
so if perf is critical, avoid using local time