Skip to content

Commit

Permalink
Merge pull request #47 from sdebnath/erlang_now
Browse files Browse the repository at this point in the history
Switch from erlang:now/0 to os:timestamp/0
  • Loading branch information
Seth Falcon committed Aug 27, 2015
2 parents 2888321 + 2b6c216 commit b6c522a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bench/src/consumer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ run(S, Config) ->
}).

init([]) ->
Now = erlang:now(),
Now = os:timestamp(),
random:seed(Now),
{ok, #state{id = Now}}.

Expand Down
2 changes: 1 addition & 1 deletion bench/src/member.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ init(Config) ->
start_up_delay(Config) ->
case proplists:get_value(start_up_delay, Config) of
T when is_integer(T) ->
random:seed(erlang:now()),
random:seed(os:timestamp()),
J = random:uniform(T),
timer:sleep(T + J),
ok;
Expand Down
2 changes: 1 addition & 1 deletion src/pooler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ take_group_member(GroupName) ->
Pools ->
%% Put a random member at the front of the list and then
%% return the first member you can walking the list.
{_, _, X} = erlang:now(),
{_, _, X} = os:timestamp(),
Idx = (X rem length(Pools)) + 1,
{PoolPid, Rest} = extract_nth(Idx, Pools),
take_first_pool([PoolPid | Rest])
Expand Down

2 comments on commit b6c522a

@binarytemple
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any plans to make a release of this. Keen to get working with Erlang 18

@seth
Copy link
Collaborator

@seth seth commented on b6c522a Oct 19, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is now included in 1.5.0. Thanks for the reminder to create a release.

Please sign in to comment.