elapsed_vcpu_ms

Functionin compute_runtimefastly 0.13.1View source
fn elapsed_vcpu_ms() -> Result<u64, FastlyStatus>

Get the amount of vCPU time that has passed since this instance was started, in milliseconds.

This function returns only time spent running on a vCPU, and does not include time spent performing any I/O operations. However, it is based on clock time passing, and so will include time spent executing hostcalls, is heavily affected by what core of what CPU is running the code, and can even be influenced by the state of the CPU.

As a result, this function should not be used in benchmarking across runs. It can be used, with caution, to compare the runtime of different operations within the same session.

Returns

Result<u64, fastly_shared::FastlyStatus>