The title is pretty much self-explanatory, I'm killing myself over this simplicity.
Looked here, but it isn't much helpful.
The title is pretty much self-explanatory, I'm killing myself over this simplicity.
Looked here, but it isn't much helpful.
the closest thing that i could find is the DateTime.ToFileTime() method. you can call this on an instance of a DateTime like so:
The method returns a Windows File Time:
you could at least time down to 100 ns intervals with it.
src: http://msdn.microsoft.com/en-us/library/system.datetime.tofiletime.aspx
I think you're going to hit the hard limits of the OS if you're timing in nanoseconds. Here's a good article on the topic:
http://www.lochan.org/2005/keith-cl/useful/win32time.html
While Windows will happily return 100 nanosecond accuracy, the clock is only guaranteed to update once every 15.6 milliseconds or so. So effectively Windows returns the time at which those updates occurred to 100 nanosecond accuracy. For more accuracy than this you probably need to be prepared to write C or assembler and run and embedded OS.
http://msdn.microsoft.com/de-de/library/system.datetime.ticks.aspx
somelike: DateTime.Ticks
If you want a timestamp to be compared between different processes, different languages (Java, C, C#), under GNU/Linux and Windows (Seven at least):
Java:
C GNU/Linux:
C Windows:
C#:
DateTime.Now
will give you the current time in milliseconds, but time that is accurate to nanoseconds is fairly impractical, at least in Windows.I think that the Stopwatch class is what you are looking for.