예제 #1
0
파일: arping.c 프로젝트: Moteesh/reactos
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;
}
예제 #2
0
void EngineTimer::Reset(void)
{
  _startTime = _thisFrame = _lastFrame = QueryTime();
  _updateCount = 0;
}
예제 #3
0
void EngineTimer::Update(void)
{
  ++_updateCount;
  _lastFrame = _thisFrame;
  _thisFrame = QueryTime();
}
예제 #4
0
	FORCEINLINE void Stop()
	{
		m_acc += QueryTime() - m_start;
	}
예제 #5
0
	FORCEINLINE void Start()
	{
		m_start = QueryTime();
	}