作业/作业5/nack-oriented-reliable-multicast-master/norm-1.5r6/protolib/include/protoDefs.h
inline LARGE_INTEGER ProtoGetPerformanceCounterFrequency()
{
    extern bool proto_performance_counter_init;
    extern LARGE_INTEGER proto_performance_counter_frequency;
    extern long proto_system_time_last_sec;
    extern unsigned long proto_system_count_roll_sec;
    extern LARGE_INTEGER proto_system_count_last;
    if (!proto_performance_counter_init)
    {
        QueryPerformanceFrequency(&proto_performance_counter_frequency);
        // Determine perf counter offset from system time
        extern long proto_performance_counter_offset;
        if (0 != proto_performance_counter_frequency.QuadPart)
        {
            LARGE_INTEGER count;
            FILETIME ft;
#ifdef _WIN32_WCE       
			SYSTEMTIME st;
			QueryPerformanceCounter(&count);
			GetSystemTime(&st);
			SystemTimeToFileTime(&st, &ft);
#else
			QueryPerformanceCounter(&count);
			GetSystemTimeAsFileTime(&ft);
#endif // if/else _WIN32_WCE
            ULARGE_INTEGER systemTime = {ft.dwLowDateTime, ft.dwHighDateTime};
            // Convert system time to Jan 1, 1970 epoch
            const ULARGE_INTEGER epochTime = {0xD53E8000, 0x019DB1DE};
            systemTime.QuadPart -= epochTime.QuadPart;
            // Convert sytem time to seconds
            systemTime.QuadPart /= 10000000;
            // Save time and counter to detect possible counter rollover
            proto_system_time_last_sec = systemTime.LowPart;
            proto_system_count_last = count;
            proto_system_count_roll_sec = 0xffffffff / proto_performance_counter_frequency.LowPart;
            // Convert counter value to seconds
            count.QuadPart /= proto_performance_counter_frequency.QuadPart;
            proto_performance_counter_offset = systemTime.LowPart - count.LowPart;
        }
        proto_performance_counter_init = true;
    }
    return proto_performance_counter_frequency;
}
// These funcs/variables are defined/inited in "protoTime.cpp"
These funcs/variables are defined/inited in "protoTime.cpp"
These funcs / variables are defined / inited in " protoTime . cpp "
inline LARGE_INTEGER ProtoGetPerformanceCounterFrequency()
{
    extern bool proto_performance_counter_init;
    extern LARGE_INTEGER proto_performance_counter_frequency;
    extern long proto_system_time_last_sec;
    extern unsigned long proto_system_count_roll_sec;
    extern LARGE_INTEGER proto_system_count_last;
    if (!proto_performance_counter_init)
    {
        QueryPerformanceFrequency(&proto_performance_counter_frequency);
        extern long proto_performance_counter_offset;
        if (0 != proto_performance_counter_frequency.QuadPart)
        {
            LARGE_INTEGER count;
            FILETIME ft;
#ifdef _WIN32_WCE       
			SYSTEMTIME st;
			QueryPerformanceCounter(&count);
			GetSystemTime(&st);
			SystemTimeToFileTime(&st, &ft);
#else
			QueryPerformanceCounter(&count);
			GetSystemTimeAsFileTime(&ft);
#endif 
            ULARGE_INTEGER systemTime = {ft.dwLowDateTime, ft.dwHighDateTime};
            const ULARGE_INTEGER epochTime = {0xD53E8000, 0x019DB1DE};
            systemTime.QuadPart -= epochTime.QuadPart;
            systemTime.QuadPart /= 10000000;
            proto_system_time_last_sec = systemTime.LowPart;
            proto_system_count_last = count;
            proto_system_count_roll_sec = 0xffffffff / proto_performance_counter_frequency.LowPart;
            count.QuadPart /= proto_performance_counter_frequency.QuadPart;
            proto_performance_counter_offset = systemTime.LowPart - count.LowPart;
        }
        proto_performance_counter_init = true;
    }
    return proto_performance_counter_frequency;
}
inline LARGE_INTEGER ProtoGetPerformanceCounterFrequency ( ) { extern bool proto_performance_counter_init ; extern LARGE_INTEGER proto_performance_counter_frequency ; extern long proto_system_time_last_sec ; extern unsigned long proto_system_count_roll_sec ; extern LARGE_INTEGER proto_system_count_last ; if ( ! proto_performance_counter_init ) { QueryPerformanceFrequency ( & proto_performance_counter_frequency ) ; extern long proto_performance_counter_offset ; if ( 0 != proto_performance_counter_frequency . QuadPart ) { LARGE_INTEGER count ; FILETIME ft ; #ifdef _WIN32_WCE SYSTEMTIME st ; QueryPerformanceCounter ( & count ) ; GetSystemTime ( & st ) ; SystemTimeToFileTime ( & st , & ft ) ; #else QueryPerformanceCounter ( & count ) ; GetSystemTimeAsFileTime ( & ft ) ; #endif ULARGE_INTEGER systemTime = { ft . dwLowDateTime , ft . dwHighDateTime } ; const ULARGE_INTEGER epochTime = { 0xD53E8000 , 0x019DB1DE } ; systemTime . QuadPart -= epochTime . QuadPart ; systemTime . QuadPart /= 10000000 ; proto_system_time_last_sec = systemTime . LowPart ; proto_system_count_last = count ; proto_system_count_roll_sec = 0xffffffff / proto_performance_counter_frequency . LowPart ; count . QuadPart /= proto_performance_counter_frequency . QuadPart ; proto_performance_counter_offset = systemTime . LowPart - count . LowPart ; } proto_performance_counter_init = true ; } return proto_performance_counter_frequency ; }
These funcs/variables are defined/inited in "protoTime.cpp"
These funcs / variables are defined / inited in " protoTime . cpp "
// Determine perf counter offset from system time // if/else _WIN32_WCE // Convert system time to Jan 1, 1970 epoch // Convert sytem time to seconds // Save time and counter to detect possible counter rollover // Convert counter value to seconds