Autor
|
Tema: Necesito ayuda... (Leído 3,679 veces)
|
Dessa
Desconectado
Mensajes: 624
|
Probé con un celeron D 2.4, ahora voy a prubar con un PIII y un Dual Core.
|
|
|
En línea
|
Adrian Desanti
|
|
|
IvanUgu
Desconectado
Mensajes: 237
eMiNeM
|
yo tambien tengo ese problema mira el code Private Sub Command2_Click() Secuencia: If Me.Caption <> 100 Then Me.Caption = Me.Caption + 1 Sleep (0.5) GoTo Secuencia End If End Sub si cambio el Sleep (0.6) ya va muchisimo mas lento, pruevenlo... Private Sub Command2_Click() Secuencia: If Me.Caption <> 100 Then Me.Caption = Me.Caption + 1 Sleep (0.6) GoTo Secuencia End If End Sub Lo que necesito es dar pocos milisegundos y con Sleep me parece que no se puede...
|
|
|
En línea
|
Para atrapar a un ladron se necesita otro ladron... El diablo sabe por diablo, pero mas sabe por viejo...
|
|
|
cobein
|
QueryPerformanceCounter
|
|
|
En línea
|
|
|
|
Dessa
Desconectado
Mensajes: 624
|
Probé con un dual core E-5200 y lo mismo, no lo pude bajar, no creo que sea problema de micro, voy a probar con tu code IvanUgu y con el de Cobein. Saludos
|
|
« Última modificación: 17 Noviembre 2008, 22:40 pm por Dessa »
|
En línea
|
Adrian Desanti
|
|
|
Dessa
Desconectado
Mensajes: 624
|
Tampoco puedo con QueryPerformanceCounter (es 0 o 16 Milisegundos) Private Type LARGE_INTEGER LowPart As Long HighPart As Long End Type Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Command1_Click() 'KPD-Team 2001 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net
Me.Print GetTickCount
Dim T As Long, liFrequency As LARGE_INTEGER, liStart As LARGE_INTEGER, liStop As LARGE_INTEGER Dim cuFrequency As Currency, cuStart As Currency, cuStop As Currency 'Retrieve the frequency of the performance counter If QueryPerformanceFrequency(liFrequency) = 0 Then MsgBox "Your hardware doesn't support a high-resolution performance counter!", vbInformation Else 'convert the large integer to currency cuFrequency = LargeIntToCurrency(liFrequency) 'retrieve tick count QueryPerformanceCounter liStart 'do something '***************************************************** '***************************************************** '***************************************************** '***************************************************** '***************************************************** For T = 0 To 20000 'For T = 0 To 100000 DoEvents Next T '***************************************************** '***************************************************** '***************************************************** '***************************************************** '***************************************************** 'retrieve tick count QueryPerformanceCounter liStop 'convert large integers to currency's cuStart = LargeIntToCurrency(liStart) cuStop = LargeIntToCurrency(liStop) 'calculate how many seconds passed, and show the result Me.Print CStr((cuStop - cuStart) / cuFrequency)
Me.Print GetTickCount
End If
End Sub
Private Function LargeIntToCurrency(liInput As LARGE_INTEGER) As Currency 'copy 8 bytes from the large integer to an ampty currency CopyMemory LargeIntToCurrency, liInput, LenB(liInput) 'adjust it LargeIntToCurrency = LargeIntToCurrency * 10000 End Function
Private Sub Form_Paint()
'KPD-Team 2001 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net Me.Print GetTickCount
Dim T As Long, liFrequency As LARGE_INTEGER, liStart As LARGE_INTEGER, liStop As LARGE_INTEGER Dim cuFrequency As Currency, cuStart As Currency, cuStop As Currency 'Retrieve the frequency of the performance counter If QueryPerformanceFrequency(liFrequency) = 0 Then MsgBox "Your hardware doesn't support a high-resolution performance counter!", vbInformation Else 'convert the large integer to currency cuFrequency = LargeIntToCurrency(liFrequency) 'retrieve tick count QueryPerformanceCounter liStart 'do something '***************************************************** '***************************************************** '***************************************************** '***************************************************** '***************************************************** For T = 0 To 20000 'For T = 0 To 100000 DoEvents Next T '***************************************************** '***************************************************** '***************************************************** '***************************************************** '***************************************************** 'retrieve tick count QueryPerformanceCounter liStop 'convert large integers to currency's cuStart = LargeIntToCurrency(liStart) cuStop = LargeIntToCurrency(liStop) 'calculate how many seconds passed, and show the result Me.Print CStr((cuStop - cuStart) / cuFrequency)
Me.Print GetTickCount
End If
End Sub
Tal vez con una "ayudita" de Cobein resultaría
|
|
« Última modificación: 17 Noviembre 2008, 23:35 pm por Dessa »
|
En línea
|
Adrian Desanti
|
|
|
IvanUgu
Desconectado
Mensajes: 237
eMiNeM
|
A mi me pasa lo mismo no puedo hacer menos de 16ms
|
|
|
En línea
|
Para atrapar a un ladron se necesita otro ladron... El diablo sabe por diablo, pero mas sabe por viejo...
|
|
|
|
|