Learn R Programming

nanonext (version 0.2.0)

nng_timer: Timer Utility

Description

Set a timer (stopwatch). Will print a message to the console (stderr) upon completion.

Usage

nng_timer(time)

Arguments

time

time in ms. Non-integer values are translated to integer using as.integer().

Value

An external pointer to the thread created by this function.

Details

The return value of this function should not normally be assigned as this preserves the thread instead of it being automatically reaped during garbage collection.

As reaping the thread waits until the timer has completed, a possible side effect is blocking garbage collection until this has happened (not guaranteed, as garbage collection may happen on other objects first). If this is undesirable, assign the external pointer to an object and then remove it after completion.