473,499 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Thanks,

Andy
Nov 15 '05 #1
6 5498
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4674
by: Bathroom_Monkey | last post by:
I've got a newb question about Daylight Savings Time (DST). First of all here is some server info: Apache 1.3.28 PHP 4.3.6 MySQL 3.23.49 Time is set to GMT My goal is to be able to...
5
2282
by: Gord | last post by:
Many scripts and calendars call client side system time in order to make presentations. However, the client's time may be improperly set, if set at all, and/or the relevant time may be from...
5
9071
by: Erich Schreiber | last post by:
In the Python Library Reference the explanation of the time.sleep() function reads amongst others: > The actual suspension time may be less than that requested because > any caught signal will...
7
16070
by: Tim Quon | last post by:
Hi Is there any function to get the current time so I can calculate the execution time of my code? What all is in the time.h and sys/times.h? Thanks Tim
2
1618
by: Diego_Atos | last post by:
I've a problem. I've made a simple card game. Using winmm.dll i can simply play one file. However if i try to play 2 files at same time, the second stops the first one, due to the driver busy. ...
74
7671
by: Dominik Wallner | last post by:
Hi! I'm currently implementing a program which measures voltages through an external USB-AD-converter. It should output those values as time/voltage pairs. My problem is to measure the time...
1
1658
by: poison.summer | last post by:
Hello I use the following function to print out the time. But I wonder whether I can be more accurate like print out the microsecond Thanks a lot! void Print_time() { time_t now;
9
2187
by: lialie | last post by:
Hi, all Suppose have two threads, one thread(A) does heavy calculations, the other one(B) must get a accurate time.Thread B can't cost too much cpu's resource, but it must trigger an event at...
8
3427
by: ashore | last post by:
Folks, I need to find and synch some php scripts to a NTP service somewhere. I'll appreciate any info on just where/how? -AS
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.