Enhancements on wasm function execution time statistic (#2985)
Enhance the statistic of wasm function execution time, or the performance profiling feature: - Add os_time_thread_cputime_us() to get the cputime of a thread, and use it to calculate the execution time of a wasm function - Support the statistic of the children execution time of a function, and dump it in wasm_runtime_dump_perf_profiling - Expose two APIs: wasm_runtime_sum_wasm_exec_time wasm_runtime_get_wasm_func_exec_time And rename os_time_get_boot_microsecond to os_time_get_boot_us.
This commit is contained in:
@ -31,7 +31,7 @@ bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...)
|
||||
|
||||
self = os_self_thread();
|
||||
|
||||
usec = os_time_get_boot_microsecond();
|
||||
usec = os_time_get_boot_us();
|
||||
t = (uint32)(usec / 1000000) % (24 * 60 * 60);
|
||||
h = t / (60 * 60);
|
||||
t = t % (60 * 60);
|
||||
|
||||
@ -38,7 +38,7 @@ struct _timer_ctx {
|
||||
uint64
|
||||
bh_get_tick_ms()
|
||||
{
|
||||
return os_time_get_boot_microsecond() / 1000;
|
||||
return os_time_get_boot_us() / 1000;
|
||||
}
|
||||
|
||||
uint32
|
||||
|
||||
Reference in New Issue
Block a user