Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created May 2, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmyleswhite/42f01c963cf2fa7194d553887ce4dc41 to your computer and use it in GitHub Desktop.
Save johnmyleswhite/42f01c963cf2fa7194d553887ce4dc41 to your computer and use it in GitHub Desktop.
import RCall: @R_str
function runtimes(n_reps)
times = Array{Float64}(undef, n_reps)
x = rand(10_000_000)
for i in 1:n_reps
times[i] = @elapsed sum(x)
end
times
end
for r in 1:10
t = runtimes(500)
R"png(paste0($r, '.png')); plot($t, ylim=c(0.002, 0.008)); dev.off();"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment