static BOOL Ping(VOID) { LARGE_INTEGER RelativeTime; LARGE_INTEGER LargeTime; LARGE_INTEGER SentTime; DWORD Ret; BYTE TargetHW[6]; ULONG Size; WCHAR Sign[2]; WCHAR Time[100]; WCHAR StrHwAddr[18]; QueryTime(&SentTime); Size = sizeof(TargetHW); memset(TargetHW, 0xff, Size); ++Sent; Ret = SendARP(TargetAddr, SourceAddr, (PULONG)TargetHW, &Size); if (Ret == ERROR_SUCCESS) { QueryTime(&LargeTime); RelativeTime.QuadPart = (LargeTime.QuadPart - SentTime.QuadPart); if ((RelativeTime.QuadPart / TicksPerMs.QuadPart) < 1) { wcscpy(Sign, L"<"); LoadString(GetModuleHandle(NULL), IDS_1MS, Time, sizeof(Time) / sizeof(WCHAR)); } else { wcscpy(Sign, L"="); TimeToMsString(Time, sizeof(Time) / sizeof(WCHAR), RelativeTime); } swprintf(StrHwAddr, L"%02x:%02x:%02x:%02x:%02x:%02x", TargetHW[0], TargetHW[1], TargetHW[2], TargetHW[3], TargetHW[4], TargetHW[5]); FormatOutput(IDS_REPLY_FROM, TargetIP, StrHwAddr, Sign, Time); Received++; return TRUE; } return FALSE; }
void EngineTimer::Reset(void) { _startTime = _thisFrame = _lastFrame = QueryTime(); _updateCount = 0; }
void EngineTimer::Update(void) { ++_updateCount; _lastFrame = _thisFrame; _thisFrame = QueryTime(); }
FORCEINLINE void Stop() { m_acc += QueryTime() - m_start; }
FORCEINLINE void Start() { m_start = QueryTime(); }