Skip to content

Commit b162082

Browse files
committed
fixed compilation on windows
1 parent c94a5bd commit b162082

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/gpupixel/utils/util.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,9 @@ std::string Util::str_format(const char* fmt, ...) {
180180
}
181181

182182
int64_t Util::nowTimeMs() {
183-
auto time_now = std::chrono::system_clock::now();
184-
auto duration_in_ms = std::chrono::duration_cast<std::chrono::milliseconds>(time_now.time_since_epoch());
185-
int64_t ts = duration_in_ms.count();
186-
return ts;
183+
std::clock_t now = std::clock();
184+
int64_t milliseconds = (now * 1000LL) / CLOCKS_PER_SEC;
185+
return milliseconds;
187186
}
188187

189188
void Util::Log(const std::string& tag,std::string format, ...) {

0 commit comments

Comments
 (0)