Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

性能统计

开启 ASCO_PERF_RECORD 选项,以启用性能统计功能。

在需要计时的异步函数开头添加 coro_pref(); 宏,或在普通函数开头添加 func_perf(); 宏以对函数计时,普通函数暂时只能统计总运行时间。

程序运行结束后,会打印性能统计结果,如:

[ASCO] Flag 'ASCO_PERF_RECORD' is enabled, please disable it if you are building your program for releasing.

active  total   counter name
1ms     2ms     205     future_void_inline asco::sync::semaphore_base<1>::acquire() [CounterMax = 1, R = asco::core::runtime]
0ms     0ms     2       future_inline<guard> asco::sync::mutex<int>::lock() [T = int]