anchor.diff:  bench(generic_timer) ->
       {fun generic_timer_client/3, generic_server_timer}.
   
  -%% -> {Parallelism, NumberOfMessages, MessageTerm}
  -bench_params(single_small) -> {1, 700000, small()};
  -bench_params(single_medium) -> {1, 350000, medium()};
  -bench_params(single_big) -> {1, 70000, big()};
  -bench_params(sched_small)  -> {parallelism(), 200000, small()};
  -bench_params(sched_medium)  -> {parallelism(), 100000, medium()};
  -bench_params(sched_big)  -> {parallelism(), 20000, big()};
  -bench_params(multi_small)  -> {400, 2000, small()};
  -bench_params(multi_medium)  -> {400, 1000, medium()};
  -bench_params(multi_big)  -> {400, 200, big()}.
  +%% -> {Parallelism, MessageTerm}
  +bench_params(single_small) -> {1, small()};
  +bench_params(single_medium) -> {1, medium()};
  +bench_params(single_big) -> {1, big()};
  +bench_params(sched_small)  -> {parallelism(), small()};
  +bench_params(sched_medium)  -> {parallelism(), medium()};
  +bench_params(sched_big)  -> {parallelism(), big()};
  +bench_params(multi_small)  -> {400, small()};
  +bench_params(multi_medium)  -> {400, medium()};
  +bench_params(multi_big)  -> {400, big()}.
   
   small() ->
       small.
  
positive.code: %%
  %% %CopyrightBegin%
  %%
  %% Copyright Ericsson AB 2012-2017. All Rights Reserved.
  %%
  %% Licensed under the Apache License, Version 2.0 (the "License");
  %% you may not use this file except in compliance with the License.
  
negative.code:         _ -> 1
      end.
  
  create_clients(M, ServerMod, Client, Parallel) ->
      fun() ->
              State = term,
              ServerPid = ServerMod:start(State),
              PidRefs = [spawn_monitor(fun() -> Client(0, M, ServerPid) end) ||
                            _ <- lists:seq(1, Parallel)],
              timer:sleep(?MAX_TIME),
              try
                  AllPidsN = collect(PidRefs, []),
                  TotalLoops = lists:sum(AllPidsN),
                  TotalLoops
              after
                  ok = ServerMod:stop(ServerPid)
              end
      end.
  
  collect([], Result) ->
      Result;
  collect([{Pid, Ref}|PidRefs], Result) ->
      N = case erlang:process_info(Pid, dictionary) of
              {dictionary, Dict} ->
                  {?COUNTER, N0} = lists:keyfind(?COUNTER, 1, Dict),
                  N0;
              undefined -> % Process did not start in ?MAX_TIME_SECS.
                  0
          end,
      exit(Pid, kill),
      receive {'DOWN', Ref, _, _, _} -> ok end,
      collect(PidRefs, [N|Result]).
  
  run_test(Test) ->
      {T1, _} = statistics(runtime),
      Result = Test(),
      {T2, _} = statistics(runtime),
      {Result, T2 - T1}.
  