tictoc: Package tictoc.

tictocR Documentation

Package tictoc.

Description

Functions for timing, as well as implementations of Stack and StackList structures.

Details

The tictoc package provides the timing functions tic and toc that can be nested. It provides an alternative to system.time() with a different syntax similar to that in another well-known software package. tic and toc are easy to use, and are especially useful when timing several sections in more than a few lines of code.

In general, calls to tic and toc start the timer when the tic call is made and stop the timer when the toc call is made, recording the elapsed time between the calls from proc.time. The default behavior is to print a simple message with the elapsed time in the toc call.

The features include the following:

  • nesting of the tic and toc calls

  • suppressing the default output with quiet = TRUE

  • collecting the timings in user-defined variables

  • collecting the timings in a log structure provided by the package (see tic.log)

  • providing a custom message for each tic call

  • using custom callbacks for the tic and toc calls to redefine the default behavior and/or add other functionality (such as logging to a database)

In addition, this package provides classes Stack (implemented as a vector) and StackList (a stack implemented as a list), both of which support operations push, pop, first_element, last_element, clear and size.

Copyright

Copyright (C) Collective, Inc.; with portions Copyright (C) Jabiru Ventures LLC

License

Apache License, Version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0

URL

http://github.com/jabiru/tictoc

Installation from github

devtools::install_github("jabiru/tictoc")

Author(s)

Sergei Izrailev

See Also

tic, Stack


tictoc documentation built on May 29, 2024, 2:40 a.m.