Bug In System.TimeSpan Object?

D

Doug

Is it possible there is a bug with the System.TimeSpan object in .NET?
I am using it to track times and am seeing an unusual situation.

From what I understand, there are 1000 milliseconds in a second. I
have a test I ran using the TimeSpan object which when I use
TimeSpan.Milliseconds I got 658 but if I use TimeSpan.Seconds I get 5.

If it took 658 milliseconds that should be less than 1 second right?
658 milliseconds should not convert to 5 seconds should it?
 
D

Daniel O'Connell

TimeSpan.Milliseconds gives you the current milliseconds, as in
minutes:seconds:milliseconds, try using TotalMilliseconds instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top