fguihen Posted April 19, 2005 Posted April 19, 2005 if i have timeSpan a = 12,10,20,450 (as in hours , minutes, seconds, milliseconds) and i take another timespan a few seconds later which gives me time span c = (12,10,22,234), and i us c.Subtract(a), will i get (0,0,2,216)?? im a bit unsure as to how timespan works. Quote
Leaders snarfblam Posted April 20, 2005 Leaders Posted April 20, 2005 Have you tried it to see what result you get? Quote [sIGPIC]e[/sIGPIC]
fguihen Posted April 20, 2005 Author Posted April 20, 2005 i had tried and thats why i was posting. i was taking two timestamps, one at the beginning of a method and the other at the end. i would take them away to see the time taken for the method to execute, and even though quite a lot of processing went on in the method, the result was always (0,0,0,0). this is why i think that i have the wrong idea of how it works Quote
HJB417 Posted April 20, 2005 Posted April 20, 2005 static void Main(string[] args) { TimeSpan a = new TimeSpan(12,10,20,450); TimeSpan c = new TimeSpan(12,10,22,234); TimeSpan d = c -a; Console.WriteLine(d); } outputs -00:01:36 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.