统一跨平台时间函数接口。

This commit is contained in:
xinyang
2019-07-31 14:51:01 +08:00
parent 01882b97c6
commit 98bc5ef95b
23 changed files with 87 additions and 95 deletions

23
others/include/systime.h Normal file
View File

@@ -0,0 +1,23 @@
//
// Created by xinyang on 19-7-31.
//
#ifndef _PLATFORM_H_
#define _PLATFORM_H_
typedef struct{
int second;
int millisecond;
} systime;
void getsystime(systime &t);
#if defined(Linux)
#include <sys/time.h>
#elif defined(Windows)
#include <Windows.h>
#else
#error "nonsupport platform."
#endif
#endif /* _PLATFORM_H_ */