Switch from timeGetTime() to GetTickCount() which is available for UWP apps too

This commit is contained in:
Cameron Gutman
2023-07-07 21:42:28 -05:00
parent fc123218d3
commit 7914bc74a9
+3 -4
View File
@@ -14,7 +14,6 @@ typedef UINT32 QOS_FLOWID;
#ifndef HAS_PQOS_FLOWID
typedef UINT32 *PQOS_FLOWID;
#endif
#include <mmsystem.h>
#include <qos2.h>
#ifndef QOS_NON_ADAPTIVE_FLOW
#define QOS_NON_ADAPTIVE_FLOW 0x00000002
@@ -96,19 +95,19 @@ enet_deinitialize (void)
enet_uint32
enet_host_random_seed (void)
{
return (enet_uint32) timeGetTime ();
return (enet_uint32) GetTickCount ();
}
enet_uint32
enet_time_get (void)
{
return (enet_uint32) timeGetTime () - timeBase;
return (enet_uint32) GetTickCount () - timeBase;
}
void
enet_time_set (enet_uint32 newTimeBase)
{
timeBase = (enet_uint32) timeGetTime () - newTimeBase;
timeBase = (enet_uint32) GetTickCount () - newTimeBase;
}
int