Results 1 to 8 of 8

Thread: Alternative to Timer

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    55

    Alternative to Timer

    Noticed that there is no Timer function in .NET now, so what can I use instead? I just want something to do animation with so it doesn't really matter as long as it counts up at a reliable pace

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually there are two in .NET. There should be one in your components then there is a faceless one as well.

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    actually there are 3:

    one in System.Threading namespace
    other in System.Timers namespace
    another in System.Windows.Forms namespace


    \m/\m/

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Edneeis
    Actually there are two in .NET. There should be one in your components then there is a faceless one as well.
    1-Components tab [this for services and control making]
    2-Windows Forms tab [use this with windows app] .

  5. #5

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    55
    Ok I took a look at the Timer class and as far as I saw it only throws events. Now Im doing a directX program so I don't really want to go with a control. All I need is something that constantly counts up in milliseconds. I've try now.milliseconds but it only counts up to 1000 then starts over. Is there now way to get the number of milliseconds from 12:00 AM of that days or somthing??

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Originally posted by Cs30Man
    Ok I took a look at the Timer class and as far as I saw it only throws events. Now Im doing a directX program so I don't really want to go with a control. All I need is something that constantly counts up in milliseconds. I've try now.milliseconds but it only counts up to 1000 then starts over. Is there now way to get the number of milliseconds from 12:00 AM of that days or somthing??
    Environment.GetTickCount
    \m/\m/

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    API I think !

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    How about something like this:
    VB Code:
    1. Dim span As TimeSpan = Now.Subtract(Date.Parse(Now.Today & " 12:00 AM"))
    2.         MsgBox(span.TotalMilliseconds)

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