require(sm) # DELAY Function Deffinition # Written by JG Kunkel 6-9-2003 # ------------------------------------------------- DELAY<- function(T){ nextT<- Sys.time() + T while (Sys.time() < nextT) { Ret<- T } } # -------------------------------------------------- # End of Function DELAY # Demo Use of DELAY function # -------------------------------------------------- dt<-1 Y<- 0.005 * (1:200) X<- qnorm(Y, 0, 1) # Set up plot axes plot(X, Y, col='red',type='n') # Pause to allow timed beginning pause() for (I in 1:20) { color<- #FF0000 cat(format(Sys.time(), "%X"), "\n") Or <- (I-1)*10 first <- 1 + Or last <- Or + 10 lines(X[first:last], Y[first:last], lwd=2, col= 25 + I*25) dum <- DELAY(dt) }