Results 1 to 2 of 2

Thread: say you wanted to...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Question

    Say you wanted to make a little timer on your app that says how long you have been on the perticular program. How would you do that?
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb GetTickCount will be fine.

    Code:
    Option Explicit
    Private Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
    
    Private t1 As Long
    Private t2 As Long
    
    Private Sub Form_Load()
       t1 = GetTickCount
    End sub
    
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
       t2 = GetTickCount
       MsgBox "This Program have been running for " & t2 - t1 & " miliseconds."
    End Sub

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