Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
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
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...