Skip to content

StopWatch improvements #1881

Closed
Closed
@DartBot

Description

@DartBot

This issue was originally filed by @seaneagan


interface StopWatch {

  const Stopwatch(); // change to "const" constructor
  // remove Stopwatch.start(), since issue #552 provides this convenience in a much more orthogonal way

  // use getters instead of methods for elapsed times
  int get ticks(); // more descriptive name
  int get hertz(); // replaces "frequency" with self-documenting name
  int get milliseconds(); // avoids abbreviations consistent with Date, Duration
  int get microseconds(); // ditto

  void start();
  void stop();
  void reset();

  // "lap" (or "split") functionality for timing loop iterations
  void lap(); // starts a new lap
  List<int> get laps();
  List<int> get millisecondLaps();
  List<int> get microsecondLaps();
}

Metadata

Metadata

Assignees

Labels

area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-not-plannedClosed as we don't intend to take action on the reported issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions