context.record(sample)
记录由另一个时钟或执行环境进行的测量。当一个高级工具在工作线程中测量工作并且需要排除消息传输时间时,这很有用。在一个回调中,record() 与 start() 和 end() 互斥,并且必须恰好调用一次。
🌐 Records a measurement made by another clock or execution environment. This is
useful when a higher-level tool measures work in a worker and needs to exclude
message transport from the duration. record() is mutually exclusive with
start() and end() within one callback and must be called exactly once.