open source

This commit is contained in:
lvfulong
2020-11-11 16:17:13 +08:00
parent 4d989f3ecb
commit bc4ca748de
2441 changed files with 623057 additions and 2 deletions
@@ -0,0 +1,57 @@
/**
@file JCGetClockExact.h
@brief
@author James
@version 1.0
@date 2016_5_12
*/
#ifndef __JCGetClockExact_H__
#define __JCGetClockExact_H__
#include "JCSingleton.h"
#include <ctime>
#include <time.h>
#include <thread>
#include <atomic>
class JCGetClockExact : public laya::JCSingleton<JCGetClockExact>
{
#ifdef WIN32
void __WindowsTimeThread();
#else
void __LinuxTimeThread();
#endif
bool m_bWantStop;
std::thread *m_pThread;
#ifdef WIN32
std::atomic_uint32_t m_CurTime_ms;
#else
std::atomic_uint m_CurTime_ms;
#endif
void __WorkThread();
public:
JCGetClockExact();
~JCGetClockExact();
bool Init();
void Stop();
std::uint32_t GetTimeMs()
{
return m_CurTime_ms;
}
};
//------------------------------------------------------------------------------
#endif //__JCGetClockExact_H__
//-----------------------------END FILE--------------------------------