High resolution timer

  • 19 years ago

    once again the subject explains it all how can i make a timer like on a watch in vb

  • 19 years ago

    Put a timer onto your form. Set the interval to 1000 (1 second).

    Double click on the control to bring up the timer code. In there make it so that it will add 1 to a variable - the seconds. Then say that if seconds = 60 then make it equal 0 and add 1 to the minutes, likewise with hours.

    If you want you can make it more acurate by putting 1 in the interval and adding up from milliseconds instead of seconds.

  • 19 years ago

    what vaiable should i use

  • 19 years ago

    hi daz,

    i think u can try this

    put a timer and a label control on the form

    name the label control as lblTime

    double click the timer control and write this

    Private Sub Timer1_Timer()

      lblTime.Caption = Time

    End Sub

  • 19 years ago

    and also put the interval properties of the timer as 1000

  • 19 years ago


    that will only tell me what time it is wont it

    i want to make it so  that it starts on

    00.00 and in a secound 00.01 and the next secound 00.02 and so on

  • 19 years ago

    You may need a high resolution timer:


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic