Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created April 13, 2015 14:27
Show Gist options
  • Save josevalim/bd0e82d9bfaf37599b9c to your computer and use it in GitHub Desktop.
Save josevalim/bd0e82d9bfaf37599b9c to your computer and use it in GitHub Desktop.
foo from command line
-module(foo).
-compile(export_all).
start() ->
List = lists:seq(1, 1000),
{Timer, _} = timer:tc(fun() ->
lists:foreach(fun(I) ->
Name = list_to_atom("module" ++ integer_to_list(I)),
{ok, Name, _} = compile:forms([{attribute, 1, module, Name}])
end, List)
end, []),
io:format("Time: ~p.~n", [Timer]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment