apps-script-utils 2.1.1 Help

StopWatch

class StopWatch

start begins a task and stop ends it; only one runs at a time. Afterwards the watch reports the last task, the whole list and the total, in milliseconds or in seconds.

It is for finding where an execution spends its six minutes: name the steps, run it once, read the totals. setKeepTaskList(false) stops the list growing when a loop times thousands of steps.

Examples

Timing a run

const watch = new StopWatch("import"); watch.start("fetch"); // … fetch … watch.stop(); watch.start("write"); // … write … watch.stop(); watch.getTotalTimeMillis();

See also

Source

src/time/StopWatch.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.