ithewei %!s(int64=6) %!d(string=hai) anos
pai
achega
3e790590b8
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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);