ithewei 6 年之前
父节点
当前提交
3e790590b8
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      htime.h

+ 6 - 0
htime.h

@@ -29,6 +29,7 @@ inline void msleep(unsigned int ms) {
 #endif
 }
 
+// ms
 inline unsigned int gettick() {
 #ifdef OS_WIN
     return GetTickCount();
@@ -39,6 +40,11 @@ inline unsigned int gettick() {
 #endif
 }
 
+// us
+inline unsigned int getclock() {
+    return clock()*(unsigned long long)1000000 / CLOCKS_PER_SEC;
+}
+
 int month_atoi(const char* month);
 const char* month_itoa(int month);