.toc()
on a timer that was already stopped would cause a signed integer overflow. This a minor change in CppTimer
as well as Rcpp::Timer
.stop()
method of Rcpp::Timer
now returns a data.frame
with the results. This is useful if you want to set auto return to false and manually handle the results. It is also possible to call aggregate()
and access the public variable data
of Rcpp::Timer
. data
is a map containing the results (Names, Mean, Standard Deviation, Count). Look into the implementation of stop()
in "inst/rcpptimer.h" to see how this works.tic()
, toc()
and ScopedTimer()
have default values now.print.rcpptimer
method to print the results of a timer object. Timings will be scaled to a more readable unit (e.g. milliseconds, seconds, minutes, hours) when appropriate..toc()
was called more than once.CppTimer
to Timer
as it is R-specific.?rcpptimer
).CppTimer
classRcpp::CppTimer::ScopedTimer
class. This can be used to time the lifespan of an object until it goes out of scope. This is useful for timing the duration of a function or a loop. The fibonacci
example was updated to use this new class.toc()
statement).tic()
statement was found.verbose
parameter to the Timer
class to control whether above warnings should be printed or not (defaults to true
).toc()
was called without matching tic()
.
reset()
method which was not working properly in some cases where timers spread out over multiple methods.Timer
class. They were not working properly in the previous version.This is the initial release of rcpptimer
. It is based on RcppClock
but contains a number of improvements:
tic
and toc
instead of tick
and tock
to be consistent with R's tictoc
package