Advertisement
newjulia

Test_Julia

Dec 8th, 2018
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 0.21 KB | None | 0 0
  1. x=rand(1000)
  2.  
  3. function Global_variable_loops()
  4.     s=0
  5.     for i in x
  6.         s += i
  7.     return s
  8. end
  9.  
  10. function Sum_args()
  11.     s=0
  12.     for i in x
  13.         s +=i
  14.     return s
  15. end
  16.  
  17. @time Global_variable_loops()
  18. @time Sum_args()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement