EVOLUTION-MANAGER
Edit File: system.time.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: CPU Time Used</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for system.time {base}"><tr><td>system.time {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>CPU Time Used</h2> <h3>Description</h3> <p>Return CPU (and other) times that <code>expr</code> used. </p> <h3>Usage</h3> <pre> system.time(expr, gcFirst = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>Valid <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> expression to be timed.</p> </td></tr> <tr valign="top"><td><code>gcFirst</code></td> <td> <p>Logical - should a garbage collection be performed immediately before the timing? Default is <code>TRUE</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>system.time</code> calls the function <code><a href="proc.time.html">proc.time</a></code>, evaluates <code>expr</code>, and then calls <code>proc.time</code> once more, returning the difference between the two <code>proc.time</code> calls. </p> <p><code>unix.time</code> has been an alias of <code>system.time</code>, for compatibility with S, and has finally been deprecated in 2016. </p> <p>Timings of evaluations of the same expression can vary considerably depending on whether the evaluation triggers a garbage collection. When <code>gcFirst</code> is <code>TRUE</code> a garbage collection (<code><a href="gc.html">gc</a></code>) will be performed immediately before the evaluation of <code>expr</code>. This will usually produce more consistent timings. </p> <h3>Value</h3> <p>A object of class <code>"proc_time"</code>: see <code><a href="proc.time.html">proc.time</a></code> for details. </p> <h3>See Also</h3> <p><code><a href="proc.time.html">proc.time</a></code>, <code><a href="../../stats/html/time.html">time</a></code> which is for time series. </p> <p><code><a href="Sys.time.html">Sys.time</a></code> to get the current date & time. </p> <h3>Examples</h3> <pre> require(stats) system.time(for(i in 1:100) mad(runif(1000))) ## Not run: exT <- function(n = 10000) { # Purpose: Test if system.time works ok; n: loop size system.time(for(i in 1:n) x <- mean(rt(1000, df = 4))) } #-- Try to interrupt one of the following (using Ctrl-C / Escape): exT() #- about 4 secs on a 2.5GHz Xeon system.time(exT()) #~ +/- same ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>