Module: Yuki::ElapsedTime

Defined in:
docs/0_Dependencies.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



482
483
# File 'docs/0_Dependencies.rb', line 482

def disable_timer(name)
end

.enable_timer(name)

Enable a timer

Parameters:

  • name (Symbol)

    name of the timer



486
487
# File 'docs/0_Dependencies.rb', line 486

def enable_timer(name)
end

.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



491
492
# File 'docs/0_Dependencies.rb', line 491

def show(name, message)
end

.start(name)

Start the time counter

Parameters:

  • name (Symbol)

    name of the timer



478
479
# File 'docs/0_Dependencies.rb', line 478

def start(name)
end

.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



497
498
# File 'docs/0_Dependencies.rb', line 497

def sub_show(delta, message, unit)
end