public void setDuration(final long dur, final TimeUnit unit) {
        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
        this.durationNs = TimeUnit.NANOSECONDS.convert(dur, unit);
    }
Directly set the duration for the metric.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java