compiler/vm/vmprofiler

  Source   Edit

Implements a simple time profiler for the VM.

Procs

proc dump(conf: ConfigRef; prof: Profiler): string {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
Constructs a string containing a report of VM execution based on the given prof. The report is formatted and ready to print to console or similar interface.   Source   Edit
proc enter(prof: var Profiler) {.inline, ...raises: [], tags: [TimeEffect].}
  Source   Edit
proc leave(prof: var Profiler; frames: openArray[TStackFrame]) {.inline,
    ...raises: [], tags: [TimeEffect].}
If profiling is enabled, ends a measurement, updating the collected data. The data of the profiler entries associated with the frames is updated with the measured time, and the "number of samples" counter of the current active frame (last entry in the list) is incremented by one.   Source   Edit