Skip to content

Instantly share code, notes, and snippets.

View kopos's full-sized avatar
🎯
Focusing

Poorna Shashank kopos

🎯
Focusing
View GitHub Profile
@kopos
kopos / ring_code.erl
Last active December 10, 2015 19:28 — forked from anonymous/ring_code.erl
-module(ring).
-export([benchmark/2]).
%% run benchmark for N processes and M messages.
benchmark(N, M) ->
Pids = makering(N),
for(1, M, fun() -> spawn(fun() -> start(message, Pids) end) end).
%% setting up the process ring for sending
%% messages & return the Pids array