VC++ compilation
This commit is contained in:
@@ -22,9 +22,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
#if !defined _MSC_VER || defined __GNUC__
|
#if !defined _MSC_VER || defined __GNUC__
|
||||||
|
#include <chrono>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -98,8 +98,12 @@ uint16_t getTmr2MHz()
|
|||||||
|
|
||||||
U64 CoGetOSTime(void)
|
U64 CoGetOSTime(void)
|
||||||
{
|
{
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
return GetTickCount()/2;
|
||||||
|
#else
|
||||||
auto now = std::chrono::steady_clock::now();
|
auto now = std::chrono::steady_clock::now();
|
||||||
return (U64) std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count() / 2;
|
return (U64) std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count() / 2;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void simuInit()
|
void simuInit()
|
||||||
|
|||||||
Reference in New Issue
Block a user