Results 1 to 2 of 2

Thread: TimeSpan

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Location
    USA
    Posts
    122

    TimeSpan

    Hey Everyone,

    I realize this is probably really simple. I can't figure why this isn't working.

    Code:
    TimeSpan endTime = new TimeSpan(0,1,0);
    
    for (TimeSpan i = new TimeSpan(0,0,0); i < endTime; i.Add(new TimeSpan0,0,1)))
    {
          Invoker.Invoke(ProgressMade, this, new Progress(i.ToString()));
    }
    my Timespan i begins as {00:00:00} then gets incremented by 1 sec. However, nothing happens it only stays zero.

    Thanks in advance,

    -zd

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Location
    USA
    Posts
    122

    Re: TimeSpan

    I figured it out. I must be retarded. However, if there is a better way to do this please post back.

    Here is what I had
    Code:
    TimeSpan endTime = new TimeSpan(0,1,0);
    
    for (TimeSpan i = new TimeSpan(0,0,0); i < endTime; i.Add(new TimeSpan0,0,1)))
    {
          Invoker.Invoke(ProgressMade, this, new Progress(i.ToString()));
    }

    Here is what I ended up doing

    Code:
    for (TimeSpan i = new TimeSpan(0,0,0); i < endTime; i = i.Add(new TimeSpan(0,0,1)))
    {
             Invoker.Invoke(ProgressMade, this, new Progress(i.ToString()));
    }
    Thanks,

    -zd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width