Subject: [R] 'pausing' in R
From: Gardar Johannesson (gardar@stat.ohio-state.edu)
Date: Thu 22 Jun 2000 - 10:45:04 EST
Message-ID: <Pine.SOL.4.10.10006212021230.10027-100000@spatial.mps.ohio-state.edu>
I have this 'odd' problem; I need to let R pause, for a given time, before
starting next iteration in a loop. I'm using the following to do this
task, but feel a little bit guilty because I'm using as much CPU time as I
can get while pausing:
while(keepGoing) {
t.end <- proc.time()[3] + 5 ## the time this loop should end at
[block of R commands]
while(proc.time()[3] < t.end) {}
}
This guaranty, at least, 5 second evaluation time for each loop in the
above case.
Can I delay the loop more efficiently, that is, not using as much CPU time
as in the above case?
Thanks,
Gardar
I'm using version 1.1.0 on:
Machine hardware: sun4u
OS version: 5.7
Processor type: sparc
Hardware: SUNW,Ultra-250
_________________________________________________________
Gardar Johannesson Home Addr.
Department of Statistics 605 Dennison, #3
Ohio State University Columbus, OH 43215
305A Cockins Hall, 1958 Neil Av. Tel: 614-531-0102
Columbus, OH 43210 ( cellular )
Tel: 614-292-6038
Fax: 614-292-2096
e-mail: gardar@stat.ohio-state.edu
WWW: www.stat.ohio-state.edu
_________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2b25 : Mon 17 Jul 2000 - 12:33:24 EST