Results 1 to 13 of 13

Thread: RSTimer - Precision Timer 2.1.0.1

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    RSTimer - Precision Timer 2.1.0.1

    Latelly I've been working on a project where I needed a precise timer, and I did not have time to write one.

    So I looked up on the internet, and I found a free one.

    I am so impressed on the precision on this timer, that I thought to post the link here, and maybe it will benefit you also.

    This is the link where I got it:
    http://www.programmersheaven.com/dow.../download.aspx

    I did a small test to see how precise it is, I wrote this code:
    Code:
    Option Explicit
    
    Private MSCount As Long, LCount As Long
    
    Private Sub Form_Load()
        RSTimer1.Interval = 1     ' 1 millisecond
        RSTimer2.Interval = 1000  ' 1 Second
        
        RSTimer1.Enabled = True
        RSTimer2.Enabled = True
    End Sub
    
    Private Sub RSTimer1_Timer()
        MSCount = MSCount + 1
    End Sub
    
    Private Sub RSTimer2_Timer()
        Debug.Print Timer, MSCount - LCount
        LCount = MSCount
    End Sub
    This is the result I got:
    Code:
     77032.41      1000 
     77033.41      1000 
     77034.41      1000 
     77035.41      1000 
     77036.41      1000 
    ....
    As you can see, the the RSTimer2 fired exactly every 1 second, and RSTimer1 fired exactly 1000 times per second !
    Last edited by CVMichael; Sep 5th, 2007 at 09:22 AM.

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