Returns null if the profile clock is not configured for a valid event
Example
constevent = session.clock.getCurrentEvent(); if (event) { console.log(`The clock is currently profiling ${event.name}`); } else { console.log(`The clock is not currently profiling an event`); }
Read the current value of the profile clock counter.
Returns bigint
The current value of the profile clock
Example
constcount = session.clock.read();
reset
reset(): void
Reset the profile clock counter to zero.
Returns void
Example
session.clock.reset();
setCurrentEvent
setCurrentEvent(event): void
Configure the profile clock to profile/count a particular event.
Parameters
event: string | number
The id or name of the event to profile.
Returns void
Remarks
Will throw if it is not possible to configure the profile clock for this event.
Example
// by id session.clock.setCurrentEvent( 1 ); // by name (this is just an example, events differ by target) session.clock.setCurrentEvent( "CPU.discontinuity.branch" );
Disable the profile clock