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 class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      stringLabel

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

      stamp

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

      start

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

      stop

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

      timeTaken

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

      reset

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

      value

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

      runningString

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

      toString

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

      [Symbol.toPrimitive]

      (
      hint
      )
      from class_name
      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'])