Seed randomnes at Actor startup

This commit is contained in:
martinsumner 2017-03-06 21:35:02 +00:00
parent 32cdf26ffb
commit 9ad6969b0d
4 changed files with 9 additions and 5 deletions

View file

@ -353,9 +353,7 @@ log_timer(LogReference, Subs, StartTime) ->
end.
log_randomtimer(LogReference, Subs, StartTime, RandomProb) ->
{R, _S} = random:uniform_s({erlang:phash2(self()),
element(2, StartTime),
element(3, StartTime)}),
R = random:uniform(),
case R < RandomProb of
true ->
log_timer(LogReference, Subs, StartTime);