By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

How to get accurate time (to 100 nano second) in C#?

P: n/a
Thanks,

Andy
Nov 15 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Change computer language. If your app depends so much on highly-accurate
timing, then the garbage collector alone (and the fact that you have little
control over it) will mess up your timings.

--
gabriel
Nov 15 '05 #2

P: n/a
I think Win32s' QueryPerformanceCounter is the only thing that can do better
then milliseconds.

--
William Stacey, MVP

"Andy Lee" <ji*********@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
Thanks,

Andy

Nov 15 '05 #3

P: n/a
You can use c++.net with some unmanaged sections when needed.

On Wed, 4 Feb 2004 16:00:32 -0600, "Andy Lee"
<ji*********@hotmail.com> wrote:
Thanks,

Andy


Nicolas di Tada
Manas - Technology Solutions
http://www.manas.com.ar
Nov 15 '05 #4

P: n/a
Ticks is a good time measure. There are 10 000 ticks per millisecond. See TimeSpan.TicksPerMillisecond constant.

"Andy Lee" <ji*********@hotmail.com> wrote in message news:OZ**************@TK2MSFTNGP12.phx.gbl...
Thanks,

Andy

Nov 15 '05 #5

P: n/a
HKM
http://support.microsoft.com/default.aspx?scid=KB;en-
us;Q172338

According to this page, It explains the maximum possible
timer resolution for ur machine.

Regards,
-HKM
-----Original Message-----
Thanks,

Andy
.

Nov 15 '05 #6

P: n/a
Andy,
In addition to HKM's suggestion:

Here are C# & VB.NET versions of HKM's post:
http://support.microsoft.com/default...b;en-us;306979
http://support.microsoft.com/default...b;en-us;306978

The February 2004 issue of MSDN Magazine had a good article on Timers in
..NET:

http://msdn.microsoft.com/msdnmag/is...T/default.aspx

The March 2004 issue of MSDN Magazine has a second good article on Timers in
..NET:

http://msdn.microsoft.com/msdnmag/is...3/default.aspx

Hope this helps
Jay

"Andy Lee" <ji*********@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
Thanks,

Andy

Nov 15 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.