Last active
October 23, 2017 22:18
-
-
Save ggggggggg/83340e3c54cb0cc0cbc51f5d1dcd74cd to your computer and use it in GitHub Desktop.
stackexchange46809845
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkTools | |
dirname = "anotherdir" | |
isdir(dirname) || mkdir(dirname) | |
fname = joinpath(dirname,"stackexchange46809845_f.jl") | |
funname = "myfun" | |
funstr = """$funname() = rand(100)""" | |
open(fname,"w") do f | |
write(f,funstr) | |
end | |
include(fname) | |
function_name = Symbol(funname) | |
f=getfield(Main, function_name) | |
println(@belapsed myfun()) | |
println(@belapsed f()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment