Module: Yuki::ElapsedTime

Defined in:
scripts/01100 Yuki/02100 Yuki__ElapsedTime.rb

Overview

Module that allow to mesure elapsed time between two calls of #show

This module is muted when PSDK_CONFIG.release? = true

Example :

Yuki::ElapsedTime.start(:test)
do_something
Yuki::ElapsedTime.show(:test, "Something took")
do_something_else
Yuki::ElapsedTime.show(:test, "Something else took")

Class Method Summary collapse

Class Method Details

.disable_timer(name)

Disable a timer

Parameters:

  • name (Symbol)

    name of the timer

.enable_timer(name)

Enable a timer

Parameters:

  • name (Symbol)

    name of the timer

.show(name, message)

Show the elapsed time between the current and the last call of show

Parameters:

  • name (Symbol)

    name of the timer

  • message (String)

    message to show in the console

.start(name)

Start the time counter

Parameters:

  • name (Symbol)

    name of the timer

.sub_show(delta, message, unit)

Show the real message in the console

Parameters:

  • delta (Float)

    number of unit elapsed

  • message (String)

    message to show on the terminal with the elapsed time

  • unit (String)

    unit of the elapsed time