Explorar o código

+ implemented GetMsCount in the DOS unit for WASI

Nikolay Nikolov %!s(int64=3) %!d(string=hai) anos
pai
achega
e19fcd2b8b
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      rtl/wasi/dos.pp

+ 6 - 0
rtl/wasi/dos.pp

@@ -227,7 +227,13 @@ End;
 
 
 function GetMsCount: int64;
+var
+  NanoSecsPast: __wasi_timestamp_t;
 begin
+  if __wasi_clock_time_get(__WASI_CLOCKID_REALTIME,1000000,@NanoSecsPast)=__WASI_ERRNO_SUCCESS then
+    GetMsCount:=NanoSecsPast div 1000000
+  else
+    GetMsCount:=0;
 end;