473,383 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Desired 1ms timer that yields an undesired 10ms resolution

Ty
I am developing a .net application using C# that requires a 1ms timer. I
have tried creating said timer by creating a timer object
(System.Timers.Timer) that is seeded with a 1ms interval. I have also tried
creating a thread with a 1ms sleep time.

The timer object that was created will only yield a resolution as low as
10ms no matter how low the interval is set.

Most of the time the thread timer yields the same 10ms resolution as the
timer object. However, sometime the thread timer will yield the desired 1ms
resolution. I have not been able to extrapolate a pattern for this behavior.
I have also set the priority of the thread to the “Highest” level.

Can anyone shed some light on these phenomena?

--
Ty
Jan 19 '06 #1
1 2400
Hi,

Use System.Threading.Timer (resoultion around 1ms)
or Multimedia Timer
http://www.codeproject.com/csharp/le...mediatimer.asp

Hope this helps
--
Milosz Skalecki
MCP, MCAD
"Ty" wrote:
I am developing a .net application using C# that requires a 1ms timer. I
have tried creating said timer by creating a timer object
(System.Timers.Timer) that is seeded with a 1ms interval. I have also tried
creating a thread with a 1ms sleep time.

The timer object that was created will only yield a resolution as low as
10ms no matter how low the interval is set.

Most of the time the thread timer yields the same 10ms resolution as the
timer object. However, sometime the thread timer will yield the desired 1ms
resolution. I have not been able to extrapolate a pattern for this behavior.
I have also set the priority of the thread to the “Highest” level.

Can anyone shed some light on these phenomena?

--
Ty

Jan 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: William Bub | last post by:
Is there an accurate way to create a "stopwatch" good to 1/10 of a second? I'm not sure if I should use the timer control, or some way to access the computer timer. I found the following site...
2
by: Jeremy | last post by:
Hello, I'm using the setTimeout function to perform some animation. The timeout I'm using is 30ms, which works well in IE and produces smooth animation. However, in other, more standards...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
8
by: VB Programmer | last post by:
How do I put a timer in it's own thread? The reason I need this is that I may have like 30 timers going continuously and it's more efficient (right??) Thanks.
6
by: Babich | last post by:
Hi! I need some timer with precision of at least 0.1 ms. Is there any way to do it
6
by: Steve | last post by:
I am working on a emulator and need to have time based events. I've tried to use the timer control and discovered that it runs waaaaaaay slow. I set the tick frequency to 1, then in the tick...
11
by: =?Utf-8?B?RXJpYw==?= | last post by:
I'm coming from Win32 world. Now, I'm porting the existing code to C#. I cannot find the equivalent Win32 Waitable Timer in C#. I have a thread to perform some task periodically like following: ...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
1. What is a difference between System.Windows.Forms.Timer and System.Threading.Timer ? 2. How does it work? How is elpasing time counted? I.e interval is set to 10ms and a timer starts working -...
8
alexis4
by: alexis4 | last post by:
Hello! I need to slide a picture from right to left. So I need a timer event. When this event comes, I decrease pictureboxs X position by 1. The thing is that I need a timer faster than 1ms....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.