# source("BMsim1.R") # in R under Windows, use 'change dir' to read from the right place howlong<-system.time( { n<-1000000 capT<-1 tvec<-capT*0:n/n W<-0:n W[1]<-0 for (i in 1:n) { W[i+1]<-W[i] + sqrt((capT/n))*rnorm(1) } freq<-1000 pick<-freq*(0:(n/freq))+1 plot(tvec[pick],W[pick],type='l', xlab="time",ylab="W(time)", main="A Path o Bronian Motion") } ) print(c("It took", round(howlong[3],2)))