mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-15 06:01:14 +00:00
Implement os_time_get_boot_microsecond() for sgx platform (#818)
This commit is contained in:
parent
c591610111
commit
9424dad56a
|
@ -28,8 +28,16 @@ ocall_clock_nanosleep(int *p_ret, unsigned clock_id, int flags,
|
||||||
uint64
|
uint64
|
||||||
os_time_get_boot_microsecond()
|
os_time_get_boot_microsecond()
|
||||||
{
|
{
|
||||||
/* TODO */
|
#ifndef SGX_DISABLE_WASI
|
||||||
|
struct timespec ts;
|
||||||
|
if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((uint64)ts.tv_sec) * 1000 * 1000 + ((uint64)ts.tv_nsec) / 1000;
|
||||||
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SGX_DISABLE_WASI
|
#ifndef SGX_DISABLE_WASI
|
||||||
|
|
Loading…
Reference in New Issue
Block a user