I want to create a timer and start it and gets its value at any time in C# and I want to know what it is, depending on, for example, is it by seconds or milliseconds or so forth.
Are you looking for the Stopwatch class?
using System.Diagnostics;
// ...
var stopwatch = Stopwatch.StartNew();
// ...
var milliseconds = stopwatch.ElapsedMilliseconds;
Have you looked at Stopwatch class?
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspxThis is another link with some good examples: http://www.dotnetperls.com/stopwatch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With