Noticed that there is no Timer function in .NET now, so what can I use instead? I just want something to do animation with so it doesn't really matter as long as it counts up at a reliable pace
Printable View
Noticed that there is no Timer function in .NET now, so what can I use instead? I just want something to do animation with so it doesn't really matter as long as it counts up at a reliable pace
Actually there are two in .NET. There should be one in your components then there is a faceless one as well.
actually there are 3:
one in System.Threading namespace
other in System.Timers namespace
another in System.Windows.Forms namespace
:rolleyes:
1-Components tab [this for services and control making]Quote:
Originally posted by Edneeis
Actually there are two in .NET. There should be one in your components then there is a faceless one as well.
2-Windows Forms tab [use this with windows app] .
Ok I took a look at the Timer class and as far as I saw it only throws events. Now Im doing a directX program so I don't really want to go with a control. All I need is something that constantly counts up in milliseconds. I've try now.milliseconds but it only counts up to 1000 then starts over. Is there now way to get the number of milliseconds from 12:00 AM of that days or somthing??
Environment.GetTickCountQuote:
Originally posted by Cs30Man
Ok I took a look at the Timer class and as far as I saw it only throws events. Now Im doing a directX program so I don't really want to go with a control. All I need is something that constantly counts up in milliseconds. I've try now.milliseconds but it only counts up to 1000 then starts over. Is there now way to get the number of milliseconds from 12:00 AM of that days or somthing??
API I think !:rolleyes:
How about something like this:
VB Code:
Dim span As TimeSpan = Now.Subtract(Date.Parse(Now.Today & " 12:00 AM")) MsgBox(span.TotalMilliseconds)