1. hängt von der WindowsVersion ab!Ja! hat geschrieben: Der ist auch nicht genauer als die aus der API.
Beide sind min. 1ms.
2. der HighResTimer muß als solches initialisiert werden, was in der PBOSL Lib in der InitFunction passiert:
Code: Alles auswählen
/*
*
* Copyright (c) 2002-2005 by Danilo Krahn
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, Or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY Or FITNESS For A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License For more details.
*
*/
#include <PBOSL.h>
#include <windows.h>
extern TIMECAPS PBOSL_Timer_Resolution;
PBFUNCTION(void) PB_PBOSL_Timer_Init(void) {
unsigned long i;
// get Windows min & max timer resolutions
timeGetDevCaps(&PBOSL_Timer_Resolution, sizeof(TIMECAPS));
// start using high precision timers
// with minimal possible resolution
timeBeginPeriod(PBOSL_Timer_Resolution.wPeriodMin);
// init handles and procedures with 0
for(i=0; i<16; i++) {
PBOSL_Timer_Handles[i] = 0;
PBOSL_Timer_Procedures[i] = 0;
}
}
Aufrufe dieses Processes.
// Nachtrag:
Es gibt mind. 3 versch. Arten von Timern
1. normaller API-Timer
2. API-Timer als HighResolution Timer
3. MultiMedia Timer
Unterschiede sind Abhängig von WinVersion, Harware usw.