all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
13
Task/Time-a-function/R/time-a-function-1.r
Normal file
13
Task/Time-a-function/R/time-a-function-1.r
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# A task
|
||||
foo <- function()
|
||||
{
|
||||
for(i in 1:10)
|
||||
{
|
||||
mat <- matrix(rnorm(1e6), nrow=1e3)
|
||||
mat^-0.5
|
||||
}
|
||||
}
|
||||
# Time the task
|
||||
timer <- system.time(foo())
|
||||
# Extract the processing time
|
||||
timer["user.self"]
|
||||
4
Task/Time-a-function/R/time-a-function-2.r
Normal file
4
Task/Time-a-function/R/time-a-function-2.r
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Rprof()
|
||||
foo()
|
||||
Rprof(NULL)
|
||||
summaryRprof()
|
||||
Loading…
Add table
Add a link
Reference in a new issue