Created
January 9, 2014 16:04
-
-
Save fsodogandji/8336636 to your computer and use it in GitHub Desktop.
A Renaud's powered bench :)
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
| f(F),F=fun(N)->S=self(),G=fun(_,0,_,L)->L;(G1,N1,Ref,L)->receive {Ref, Ret}-> G1(G1,N1-1,Ref,[Ret|L]) end end, | |
| Ref=erlang:make_ref(),L=[random:uniform(1000)||_<-lists:seq(1,N)], | |
| FW=fun()->S ! {Ref,lists:foldl(fun(J,A)->lists:sort(L) end,1,L)} end, | |
| {T,_V}=timer:tc(fun()->[spawn( FW )||_I <-L],G(G,length(L),Ref,[]) end),T/1000 end. | |
| F(100). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment