Skip to content

Instantly share code, notes, and snippets.

@Gustav-Simonsson
Created May 4, 2012 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Gustav-Simonsson/2597846 to your computer and use it in GitHub Desktop.
Save Gustav-Simonsson/2597846 to your computer and use it in GitHub Desktop.
-module(foo).
-compile(export_all).
printer(Text, Num_times, Time_between) ->
[begin io:format(Text), timer:sleep(Time_between) end
|| _ <- lists:seq(1, Num_times)].
main() ->
spawn(?MODULE, printer, ["Hello~n", 30, 10]),
spawn(?MODULE, printer, ["World~n", 40, 15]),
spawn(?MODULE, printer, ["Parallel World~n", 40, 20]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment