[R] how to obtain the CPU time of my program

Stefan Grosse singularitaet at gmx.net
Thu Sep 13 17:36:09 CEST 2007


-------- Original Message  --------
Subject: [R] how to obtain the CPU time of my program
From: gang xu <ucecgxu at ucl.ac.uk>
To: r-help at stat.math.ethz.ch
Date: 13.09.2007 17:16
> Dear R users and experts,
>
> I am current running a program (a series of commands) in R. such as:
>
> A <- as.matrix(read.table("C:/LP.txt"));
>
> a=which(memb==q); b=a; B=as.matrix(A[a,b])
>
> LS=sum(B)/2;
>
> TL=sum(A)/2
>
> i<-c(1:NN);
>
> D=sum(A[a,i]);
>
> how can i obtain the CPU time used for these commands ?
>
> I have seen the system.time function but i am not sure how to use it. Could anyone help me ?
>   
?system.time

> ****** If we have a number of commands, how can we know the CPU for these commands *******
>
>
> Thanks a lot for your time and help
>
> Have a nice day!
>
> Warm Regards
>
> Marshall
>
>
> 	[[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.
>
>
>   


-=-=-
... Those people who think they know everything are a great annoyance to
those of us who do. (Isaac Asimov)



More information about the R-help mailing list