예제 #1
0
//
//  OS_Delta_Time: C
//
// Return time difference in microseconds. If base = 0, then
// return the counter. If base != 0, compute the time difference.
//
// Note: Requires high performance timer.
//      Q: If not found, use timeGetTime() instead ?!
//
i64 OS_Delta_Time(i64 base, int flags)
{
    LARGE_INTEGER freq;
    LARGE_INTEGER time;

    if (!QueryPerformanceCounter(&time))
        OS_Crash(cb_cast("Missing resource"), cb_cast("High performance timer"));

    if (base == 0) return time.QuadPart; // counter (may not be time)

    QueryPerformanceFrequency(&freq);

    return ((time.QuadPart - base) * 1000) / (freq.QuadPart / 1000);
}
예제 #2
0
파일: host-lib.c 프로젝트: Oldes/r3
*/	i64 OS_Delta_Time(i64 base, int flags)
/*
**		Return time difference in microseconds. If base = 0, then
**		return the counter. If base != 0, compute the time difference.
**
**		Note: Requires high performance timer.
** 		Q: If not found, use timeGetTime() instead ?!
**
***********************************************************************/
{
	LARGE_INTEGER freq;
	LARGE_INTEGER time;

	if (!QueryPerformanceCounter(&time))
		OS_Crash(cb_cast("Missing resource"), "High performance timer");

	if (base == 0) return time.QuadPart; // counter (may not be time)

	QueryPerformanceFrequency(&freq);

	return ((time.QuadPart - base) * 1000) / (freq.QuadPart / 1000);
}
예제 #3
0
파일: host-main.c 프로젝트: meshpoint/ren-c
/* coverity[+kill] */
void Host_Crash(const char *reason) {
	OS_Crash(cb_cast("REBOL Host Failure"), cb_cast(reason));
}
예제 #4
0
/* coverity[+kill] */
void Host_Crash(REBYTE *reason) {
	OS_Crash("REBOL Host Failure", reason);
}