[R] System.time

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Feb 12 10:28:41 CET 2009


On Wed, 2009-02-11 at 18:49 -0600, John Kerpel wrote:
> Hi folks!
> Does anyone know why I might see something like this after running
> system.time?
> 
> system.time(svd(Mean_svd_data))
>    user  system elapsed
>       0       0       0
> 
> The data set is tiny and the function returns results instantly, but
> shouldn't it still give me a time?

Jim has already suggested why this might be the case. When I'm testing
the speed of things like this (that are in and of themselves very quick)
for situations where it may matter, I wrap the function call in a call
to replicate():

system.time(replicate(1000, svd(Mean_svd_data)))

to run it 1000 times, and that allows me to judge how quickly the
function executes.

HTH

G

> 
> Thanks,
> 
> John
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090212/fb01fc42/attachment-0002.bin>


More information about the R-help mailing list