getTimer function

int getTimer()

Returns the elapsed time since the start of the GraphX scene in milliseconds, or 0 if it hasn't been started yet.

This function is equivalent to the getTimer() function in ActionScript or JS. If the stopwatch is not running, it starts it automatically.

Implementation

int getTimer() {
  if (!_stopwatch.isRunning) {
    _stopwatch.start();
  }
  return _stopwatch.elapsedMilliseconds;
}