Time Functions and Macros

  • GetTicksPerFrame() - Returns the number of ticks per frame.
  • SetTicksPerFrame() - Sets the number of ticks per frame.
  • GetFrameRate() - Retrieves the current frame rate in frames per second used by 3ds Max. This is the Frames Per Second (FPS) setting in the Time Configuration dialog.
  • SetFrameRate() - Sets the current frame rate used by 3ds Max. This is the Frames Per Second (FPS) setting in the Time Configuration dialog. Note: This call is simply another way to adjust the ticks per frame setting.
  • GetTimeDisplayMode() - Returns the display mode in use for time values.
    • DISPTIME_FRAMES - Frame display format.
    • DISPTIME_SMPTE - SMPTE time code format.
    • DISPTIME_FRAMETICKS - Frame:Ticks format.
    • DISPTIME_TIMETICKS - MM:SS:Ticks format.

  • SetTimeDisplayMode() - Sets the display mode for time values. When this setting is changed a notification is sent to automatically update any UI controls containing time values (including plug-in custom controls).
    • DISPTIME_FRAMES - Frame display format.
    • DISPTIME_SMPTE - SMPTE time code format.
    • DISPTIME_FRAMETICKS - Frame:Ticks format.
    • DISPTIME_TIMETICKS - MM:SS:Ticks format.

  • TimeToString() - Formats a time value into a string based on the current frame rate, ticks per frame and display mode.
  • StringToTime() - Parses the specified time string using the current time settings (frame rate, ticks per frame, and time format) and converts it to a TimeValue.

Time Macros

The following macros are useful when working with time (from .h).

  • TIME_TICKSPERSEC - Number of ticks in a second.
  • TicksToSec() - Converts from ticks to seconds.
  • SecToTicks() - Converts from seconds to ticks
  • TicksSecToTime() - Converts a number of seconds plus a number of ticks to a TimeValue.
  • TimeToTicksSec() - Converts a TimeValue to a number of seconds plus a number of ticks to a
  • TIME_PosInfinity - Returns a time value which represents positive infinity.
  • TIME_NegInfinity - Returns a time value which represents negative infinity.

See Also