Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As Dword
Global qFreq, qStart, qStop AS QUAD
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Test", 20,10,120,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case 100 : SpeedTest
End Select
End Select
End Function
Sub SpeedTest
QueryPerformanceFrequency qFreq
QueryPerformanceCounter qStart
'---------------------------------------
'.... do something here
'---------------------------------------
QueryPerformanceCounter qStop
? Format$((qStop-qStart)/qFreq,"###.000") & " seconds"
End Sub
http://www.garybeene.com/sw/gbsnippets.htm