473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Bug In System.TimeSpan Object?

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?
Nov 15 '05 #1
1 2410
TimeSpan.Milliseconds gives you the current milliseconds, as in
minutes:seconds:milliseconds, try using TotalMilliseconds instead.
"Doug" <dn******@dtgnet.com> wrote in message
news:ff**************************@posting.google.c om...
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?

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug | last post by:
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...
10
by: violin wang | last post by:
hi When I set up a timer in my program, I used public Timer(TimerCallback, object, TimeSpan, TimeSpan) constructor. I want the timer to fire after a mount of time, so I wrote "new Timer(new...
2
by: Justin Grieves | last post by:
Hello all, I've been trying to determine the difference in minutes between two DateTime objects (startTime and endTime) in C# using the TimeSpan object (ts). I am populating the two DateTime...
3
by: Ivan A. | last post by:
Hi! Why I can't serialize TimeSpan structure with XmlSerializer? This is what I do: using System; using System.IO; using System.Xml; using System.Xml.Serialization;
5
by: Deiussum | last post by:
I'm running into an issue where I have a timer that appears to be timing out immediately, when it shouldn't be timing out for about int.MaxValue milliseconds. I have written a small app that...
4
by: DWW | last post by:
System.DateTime returns a string with the date and time. I want to convert the time to an integer, for example, convert 10:24:45 to 102445. Much research has turned up a myriad of variations on...
2
by: DWalker | last post by:
In Visual Studio (Visual Basic) .NET 2002, I noticed that this: Dim Elapsed as DateTime = Now - Now gives a "compile time" error (error in the IDE), saying that the '-' operator is not...
3
by: Rob Meade | last post by:
Hi all, I'm having a bit of trouble with the following function.... Private Function GetSystemUpTime() As TimeSpan ' declare variables Dim Result As TimeSpan Dim PerformanceCounter As...
5
by: prasanta.bhowmik | last post by:
Hello, I created a object of TimeSpan only with minute and expected the result in hours and minute, but its returning wrong result. My Code is : TimeSpan timeSpan = new TimeSpan(0,2400,0);...
5
by: Brian | last post by:
Hello all. I have a simple application that I was using to test and understand the System.Timers.Timer and noticed that when I stop the application, on occasion, it throughs the following...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.