Gets the number of milliseconds elapsed since the system started.
Assembly: mscorlib (in mscorlib.dll)
The value of this property is derived from the system timer and is stored as a 32-bit signed integer. Note that, because it is derived from the system timer, the resolution of theproperty is limited to the resolution of the system timer, which is typically in the range of 10 to 16 milliseconds.
Because the value of the Int32.MaxValue for approximately 24.9 days, then jump to Int32.MinValue, which is a negative number, then increment back to zero during the next 24.9 days. You can work around this issue by calling the Windows GetTickCount function, which resets to zero after approximately 49.7 days, or by calling the GetTickCount64 function.property value is a 32-bit signed integer, if the system runs continuously, will increment from zero to
DateTime.Ticks property, which is the number of 100-nanosecond intervals that have elapsed since 1/1/0001, 12:00am.is different from the
Use the DateTime.Now property to obtain the current local date and time on this computer.
The following example demonstrates how to retrieve the positive range of values returned by the Int32.MinValue, which is a negative number, and Int32.MaxValue once every 49.8 days. This code sample removes the sign bit to yield a nonnegative number that cycles between zero and MaxValue once every 24.9 days.property. The property cycles between
Available since 4.5
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1