Skip to content

Standard Library

DYMS comes with a set of built-in modules that provide additional functionality. You can import these modules into your scripts using the import keyword.

time Module

The time module provides functions for working with time.

  • now(): Returns the current time in seconds since the Unix epoch.
  • millis(): Returns the current time in milliseconds since the Unix epoch.
  • sleep(seconds): Pauses the execution of the script for the specified number of seconds.

fmaths Module

The fmaths module provides a collection of advanced mathematical functions.

  • pi(): Returns the value of Pi.
  • e(): Returns the value of Euler's number.
  • sqrt(x): Returns the square root of x.
  • pow(x, y): Returns x raised to the power of y.
  • abs(x): Returns the absolute value of x.
  • sin(x), cos(x), tan(x): Trigonometric functions.
  • log(x), log10(x), log2(x): Logarithmic functions.
  • exp(x): Returns e raised to the power of x.
  • ceil(x), floor(x), round(x): Rounding functions.
  • min(x, y), max(x, y): Returns the minimum or maximum of two numbers.