srecord noeq StepperWithStats(Steppable steppable) > MetaWithChangeListeners is Steppable { settableWithVar new TimestampRange timeRange; settableWithVar long stepCount; settableWithVar bool done; public bool step() { if (done) false; if (steppable == null) false; ping(); if (timeRange.start() == null) timeRange.startTime(tsNow()); stepCount(stepCount+1); if (steppable.step()) true; // steppable ended timeRange.endTime(tsNow()); done(true); false; } S renderStats() { S s = nSteps(stepCount); if (done) { s += " (done"; if (timeRange.complete()) s += " in " + formatSeconds(timeRange.duration(), 1) + "s"; s += ")"; } ret s; } }