To start the watch, call start() . At this point you can:
split() the watch to get the time whilst the watch continues in the
background. unsplit() will remove the effect of the split. At this point,
these three options are available again.
suspend() the watch to pause it. resume() allows the watch
to continue. Any time between the suspend and resume will not be counted in
the total. At this point, these three options are available again.
It is intended that the output methods toString() and getTime()
should only be called after stop, split or suspend, however a suitable result will
be returned at other points.
NOTE: As from v2.1, the methods protect against inappropriate calls.
Thus you cannot now call stop before start, resume before suspend or
unsplit before split.
1. split(), suspend(), or stop() cannot be invoked twice
2. unsplit() may only be called if the watch has been split()
3. resume() may only be called if the watch has been suspend()
4. start() cannot be called twice without calling reset()
StopWatchprovides a convenient API for timings.To start the watch, call start() . At this point you can:
It is intended that the output methods toString() and getTime() should only be called after stop, split or suspend, however a suitable result will be returned at other points.
NOTE: As from v2.1, the methods protect against inappropriate calls. Thus you cannot now call stop before start, resume before suspend or unsplit before split.
1. split(), suspend(), or stop() cannot be invoked twice
2. unsplit() may only be called if the watch has been split()
3. resume() may only be called if the watch has been suspend()
4. start() cannot be called twice without calling reset()