g.js — graphical objects for JavaScript

elapsedSecondselapsedSeconds

Get the number of seconds since the start of the animation.

g.elapsedSeconds()

This returns a floating-point number, with milliseconds behind the comma.

The advantage over frame is that elapsedSeconds returns even values regardless of how many frames per seconds your computer can display.

See Also

  • frame: Get the current frame number.
  • sineWave: Smoothly interpolate between values.