Application Framework Reference

Splunk API

getDuration()

The getDuration() method gets the interval between the absolute current time range earliest and latest times.

Synopsis

duration = getDuration()

Return Value

Integer

Interval, in milliseconds, between the earliest and latest times in the current time range. Returns -1 , if the current time range is relative.

Example

if (timeRange.getDuration() == -1)
{
    this._activator.text(timeRange.toConciseString());
}
else {
    this._activator.text(this.CUSTOM_TIME_LABEL);
}
 

See Also

isAbsolute()
isRealTime()
isRelative()