Per la precisione!

La funzione Timer() è accurata solo fino a circa 55 millisecondi... ecco qui un'idea del solito grande Francesco Balena per ottenere un benchmark accurato al singolo millisecondo!
Option Explicit

Private Type SMPTE
    hour As Byte
    min As Byte
    sec As Byte
    frame As Byte
    fps As Byte
    dummy As Byte
    pad(2) As Byte
End Type

Private Type MMTIME
    wType As Long
    units As Long
    smpteVal As SMPTE
    songPtrPos As Long
End Type

Private Declare Function timeGetSystemTime Lib "winmm.dll" _
(lpTime As MMTIME, ByVal uSize As Long) As Long

Function GetCurrentTime() As Long
'assegna questo valore al campo wType
'per specificare le misure temporali in millisecondi
Const TIME_MS = 1
Dim mmt As MMTIME
    mmt.wType = TIME_MS
    timeGetSystemTime mmt, LenB(mmt)
    GetCurrentTime = mmt.units
End Function

posted @ venerdì 15 luglio 2016 20:05

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 6 and type the answer here:
 

Live Comment Preview: