Nov 25th, 2006, 10:44 AM
#1
Thread Starter
Member
Re: Timers [Faster Time]
so, since this way looks awesome... lol ( Thats a huge thanks ^^; )
Can i finish my program, and then like email you the form, becasue i still dont know how im going to incorporate this in the way i would like to
Thanks a ton!
Nov 28th, 2006, 09:28 PM
#2
Thread Starter
Member
Re: Timers [Faster Time]
Ok, ive been fooling around with your timer code, and i cannot quite seem to get it to work... Ive uploaded what i basically would like the speeds to be
(There are minutes and hours, but i dont expect anyone to spend an hour watching a form -.-)
I also dont know how to call this as a you would a timer... like for a timer you go
VB Code:
private sub timer1_timer()
'Your cude is processed for every interval
end sub
how am i going to do this for your code?
VB Code:
private sub seconds()
msgbox "Look at me, im so annoying, i appear every second :D"
end sub
something like that maby?
Thankyou
~Cody
Attached Files
Nov 28th, 2006, 10:04 PM
#3
Addicted Member
Re: Timers [Faster Time]
I'm probably wrong here, but
VB Code:
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpCount As Currency) As Long
Private Tick_Count As Currency
Private Start_Time As Currency
Private End_Time As Currency
Private Delta_Time As Currency
Private Str As String
Private sub1, sub2, sub3, sub4, sub5, seconds, mins As Long
Private Sub Form_Activate()
AutoRedraw = True
ScaleMode = 3
QueryPerformanceFrequency Tick_Count
QueryPerformanceCounter Start_Time
Do
DoEvents
Cls
Delta_Time = (End_Time - Start_Time) / Tick_Count
Caption = Delta_Time
If Delta_Time >= 0.0001 Then
QueryPerformanceCounter Start_Time
sub5 = sub5 + 1
If sub5 = 10 Then
sub5 = 0
sub4 = sub4 + 1
End If
If sub4 = 10 Then
sub4 = 0
sub3 = sub3 + 1
End If
If sub3 = 10 Then
sub3 = 0
sub2 = sub2 + 1
End If
If sub2 = 10 Then
sub2 = 0
sub1 = sub1 + 1
End If
If sub1 = 10 Then
sub1 = 0
seconds = seconds + 1
End If
If seconds = 60 Then
seconds = 0
mins = mins + 1
End If
QueryPerformanceCounter Start_Time
End If
Str = "Time Elapsed: " & mins & seconds & sub1 & sub2 & sub3 & sub4 & sub5
Print Str
QueryPerformanceCounter End_Time
Loop
End Sub
If i understand it correctly, you were reseting the time constantly so it couldn't add up the numbers for you
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width