Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.StopWatch
Source: src/com/multiversesocial/hyperview/StopWatch.java

StopWatch

HyperView V3.2 — class
version V3.2 class

Summary

A simple stopwatch based on system nanotime. By Tony Swain Jan 11 2017

Source file: StopWatch.java

Hierarchy

Extends: none

Implements: none

Referenced HyperView classes

Media files used

Declaration & members

public class StopWatch

Declared in src/com/multiversesocial/hyperview/StopWatch.java, lines 10–61. 3 field(s), 1 constructor(s), 4 method(s). Every member has an anchor you can link to (e.g. StopWatch.html#<id>).

Fields (3)

DeclarationValue / initializerDescriptionSource
long endNanosNo comment in source; assigned in stop().line 13
long startNanosNo comment in source; assigned in start(); used in stop().line 12
long totalTimeNanosNo comment in source; assigned in stop(); used in toString().line 14

Constructors (1)

SignatureDescriptionSource
StopWatch()I compute therefor I am.line 16

Methods (4)

SignatureDescriptionSource
public static void main(String[] args)3 statement(s); calls tStopWatch.start(), tStopWatch.wait(), tStopWatch.stop(), tStopWatch.notifyAll(), tStopWatch.toString(); creates StopWatch.line 42
public void start()Sets startNanos = (long)System.nanoTime().line 21
public void stop()2 statement(s); calls System.nanoTime().line 26
public String toString()6 statement(s); calls tStringBuilder.append(), new DecimalFormat("#.##########").format(), tStringBuilder.toString(); creates StringBuilder, DecimalFormat.
Overrides Object.toString()
line 32

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — HyperConnectionHandler.java, line 720

  720  StopWatch tStopWatch = new StopWatch();
Hits--