## org.apache.solr.common.util
Class RTimer

    java.lang.Object
      org.apache.solr.common.util.RTimer

    public class RTimer

extends Object

A recursive timer. RTimers are started automatically when instantiated; subtimers are also started automatically when created.

Since:
  solr 1.3
Version:
  $Id: RTimer.java 724867 2008-12-09 20:23:52Z ryan $

Field Summary
`protected SimpleOrderedMap<RTimer>` `children`
`protected double` `culmTime`
`static int` `PAUSED`
`static int` `STARTED`
`protected double` `startTime`
`protected int` `state`
`static int` `STOPPED`
`protected double` `time`

Constructor Summary
`RTimer()`

Method Summary
`NamedList` `asNamedList()`
`SimpleOrderedMap<RTimer>` `getChildren()` Manipulating this map may have undefined results.
`double` `getTime()` Get total elapsed time for this timer.
`static void` `main(String[] argv)` Testing
`protected double` `now()` Get current time May override to implement a different timer (CPU time, etc).
`void` `pause()`
`void` `resume()`
`double` `stop()` Recursively stop timer and sub timers
`RTimer` `sub(String desc)` Create new subtimer with given name Subtimer will be started.
`String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### STARTED

    public static final int STARTED

See Also:
  Constant Field Values

### STOPPED

    public static final int STOPPED

See Also:
  Constant Field Values

### PAUSED

    public static final int PAUSED

See Also:
  Constant Field Values

### state

    protected int state

### startTime

    protected double startTime

### time

    protected double time

### culmTime

    protected double culmTime

### children

    protected SimpleOrderedMap<RTimer> children

Constructor Detail

### RTimer

    public RTimer()

Method Detail

### now

    protected double now()

  Get current time May override to implement a different timer (CPU time, etc).

### stop

    public double stop()

  Recursively stop timer and sub timers

### pause

    public void pause()

### resume

    public void resume()

### getTime

    public double getTime()

  Get total elapsed time for this timer. Timer must be STOPped.

### sub

    public RTimer sub(String desc)

  Create new subtimer with given name Subtimer will be started.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### asNamedList

    public NamedList asNamedList()

### getChildren

    public SimpleOrderedMap<RTimer> getChildren()

  Manipulating this map may have undefined results.

### main

    public static void main(String[] argv)
                     throws InterruptedException

  Testing

  Throws:
    `InterruptedException`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.