TimeIt Class

<script src="./point_src/timeit"></script>

The TimeIt entity provides time taken tests for running code.

const timeit = new TimeIt('my label')
timeit.start()
// ... insert delay ...
timeit.stop()
timeit.timeTaken()
// TimeIt("my label") complete 100ms

This can be reduced to two statements, by assigning a startNow bool to the constructor:

const timeit = new TimeIt('my label', true)
console.log(timeit.stop().toString())
// TimeIt("my label") complete 2002ms
Meta Data
title TimeIt Class
dependencies ()
unused_keys ()
unknown_keys ()
filepath_exists True
path timeit
filepath timeit.js
clean_files ()

  • ClassDeclaration
    class comments:

    title: TimeIt Class

    The TimeIt entity provides time taken tests for running code.

    const timeit = new TimeIt('my label')
    timeit.start()
    // ... insert delay ...
    timeit.stop()
    timeit.timeTaken()
    // TimeIt("my label") complete 100ms
    

    This can be reduced to two statements, by assigning a startNow bool to the constructor:

    const timeit = new TimeIt('my label', true)
    console.log(timeit.stop().toString())
    // TimeIt("my label") complete 2002ms
    

    return this.value;

    • constructor

      constructor

      (
      label , startNow
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      stringLabel

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      stamp

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      start

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      stop

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      timeTaken

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      reset

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • get

      value

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      runningString

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      toString

      (
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      [Symbol.toPrimitive]

      (
      hint
      )
      from TimeIt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      return this.value;

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])