Welcome, Guest. Please Login or Register.
YaBB - Yet another Bulletin Board
09/06/10 at 08:00:47
News: Visit YaBB today Wink
Home Help Search Login Register


Pages: 1
Reply Send Topic Print
How do you do GetTickCount in the C# / .Net world? (Read 1719 times)
Nohpforme
YaBB Newbies
*


I Love YaBB 2!

Posts: 4
How do you do GetTickCount in the C# / .Net world?
11/16/08 at 21:28:30
 
In Win32, I use GetTickCount to tell how long it's been since something has happened.  For example, I might do a GetTickCount when I start something and then call it again to see how long it's been since that action started.
 
What's the normal way of doing this in C# or .Net?
Back to top
 
 
  IP Logged
Nohpforme
YaBB Newbies
*


I Love YaBB 2!

Posts: 4
Re: How do you do GetTickCount in the C# / .Net wo
Reply #1 - 11/17/08 at 10:55:04
 
Ok, I found this page of C# equivalents for MFC / Win32 API calls at c# quick equivalents.
 
It says there to use DateTime.Now.Ticks for GetTickCount().
Back to top
 
 
  IP Logged
pandalibryan
YaBB Newbies
*


I Love YaBB 2!

Posts: 18
Re: How do you do GetTickCount in the C# / .Net wo
Reply #2 - 11/18/08 at 14:40:13
 
That would probably work for what you're doing.
 
There's also System.Environment.TickCount which returns something closer to the Win32 GetTickCount().  It returns the number of milliseconds since the system started, up to about 25 days.
 
Here's more info on that one: http://msdn.microsoft.com/en-us/library/system.environment.tickcount.aspx .
Back to top
 
 
  IP Logged
Pages: 1
Reply Send Topic Print