How to get precise DateTime in C# -
i know datetime.utcnow
not have relatively high degree of precision (10-15 ms resolution).
this problem me because in log files, want better resolution purposes of resolving race conditions.
the question is: how can current date/time better precision datetime.utcnow
offers?
the solution i've seen till has been this: https://stackoverflow.com/a/15008836/270348. suitable way solve problem?
you can use stopwatch
more precise measurements of time. can have each log entry record time start of first operation. if it's important, can record datetime
of first operation , therefore calculate times of rest, sounds having ticks/nanoseconds since start of first operation enough purposes.
Comments
Post a Comment