notesy::perf

Timing its own work: how long indexing notes takes, say, each time, and in all. Needs nothing.

rustuse notesy::{log, perf};

pub fn ready() {
    let timer = perf::start("index notes");
    // ... the work ...
    let ms = timer.stop();
    log::debug(`indexed in ${ms} ms`);
}
Function What it does
perf::start(name) A timer, running: name is a few words (1 to 40 characters) to count it under.
timer.stop() Stops it, counts it under its name, and says how many milliseconds it ran. Stopped again, it says the same and counts nothing more.

In developer mode (Settings > General > Developer mode), a plugin's page lists what it times, under its script's time: how many times, their time in all, and the longest; and Settings > Logs & performance lists it with every plugin's. notesy counts the rest itself: compiling the script, and each call into it (ready, a view built, a command, an event), with the slowest. At most 64 names are kept.

To draw numbers of its own, like these, a view has view::sparkline.

Every page