anchor.diff:                  St
           end).
   
  -do_measure(_Config) ->
  +do_measure(Iterations) ->
       Algs =
           case crypto_support() of
               ok ->
  
positive.code:     TwoPi = 2 * math:pi(),
      _ =
          measure_1(
            fun (_) -> 0 end,
            fun (State, _, Mod) ->
                    measure_loop(
                      fun (State0) ->
                              {U1, State1} = Mod:uniform_real_s(State0),
                              {U2, State2} = Mod:uniform_s(State1),
                              R = math:sqrt(-2.0 * math:log(U1)),
                              T = TwoPi * U2,
                              Z0 = R * math:cos(T),
                              Z1 = R * math:sin(T),
                              ?CHECK_NORMAL({Z0 + Z1, State2}, X, State3)
                      end,
                      State)
            end,
            exsss, TMarkNormalFloat, OverheadNormalFloat),
      ok.
  
  -define(LOOP_MEASURE, (?LOOP div 5)).
  
  measure_loop(Fun, State) ->
      measure_loop(Fun, State, ?LOOP_MEASURE).
  %%
  measure_loop(Fun, State, N) when 10 =< N ->
      %% Loop unrolling to dilute benchmark overhead...
      measure_loop(
        Fun,
        Fun(Fun(Fun(Fun(Fun(
                          Fun(Fun(Fun(Fun(Fun(
                                            State)))))))))),
        N - 10);
  measure_loop(Fun, State, N) when 1 =< N ->
      measure_loop(Fun, Fun(State), N-1);
  measure_loop(_, _, _) ->
      ok.
  
  measure_1(RangeFun, Fun, Algs) ->
      WMark = measure_1(RangeFun, Fun, hd(Algs), warm_up, 0),
      Overhead =
          measure_1(
            fun (_) -> 1 end,
            fun (State, Range, _) ->
                    measure_loop(
                      fun (State0)
                            when
                                is_integer(State0),
                                1 =< State0,
                                State0 =< Range ->
                              State0
                      end,
                      State)
            end,
            overhead, WMark, 0),
      TMark = measure_1(RangeFun, Fun, hd(Algs), undefined, Overhead),
      [TMark,Overhead] ++
          [measure_1(RangeFun, Fun, Alg, TMark, Overhead) || Alg <- tl(Algs)].
  
  measure_1(RangeFun, Fun, Alg, TMark, Overhead) ->
      Parent = self(),
      {Mod, State} =
          case Alg of
              overhead ->
                  {?MODULE, 1};
              crypto64 ->
                  {rand, crypto64_seed()};
              crypto_cache ->
                  {rand, crypto:rand_seed_alg(crypto_cache)};
              crypto ->
                  {rand, crypto:rand_seed_s()};
              crypto_aes ->
                  {rand,
  		 crypto:rand_seed_alg(
  		   crypto_aes, crypto:strong_rand_bytes(256))};
              random ->
                  {random, random:seed(os:timestamp()), get(random_seed)};
              crypto_bytes ->
                  {?MODULE, ignored_state};
              crypto_bytes_cached ->
                  {?MODULE, <<>>};
              unique_phash2 ->
                  {?MODULE, ignored_state};
              system_time_rem ->
                  {?MODULE, ignored_state};
              mcg35_inline ->
                  {_, S} = rand:seed_s(dummy),
                  {?MODULE, (S rem ((1 bsl 35)-31 - 1)) + 1};
              lcg35_inline ->
                  {_, S} = rand:seed_s(dummy),
                  {?MODULE, S bsr (58-35)};
              lcg35_procdict ->
                  {_, S} = rand:seed_s(dummy),
                  {?MODULE, S bsr (58-35)};
              exsp_inline ->
                  {_, S} = rand:seed_s(exsp),
                  {?MODULE, S};
              procdict ->
                  {rand, rand:seed_s(exsss)};
              _ ->
                  {rand, rand:seed_s(Alg)}
          end,
      Pid = spawn_link(
              fun() ->
                      Range = RangeFun(State),
                      {T, ok} = timer:tc(fun () -> Fun(State, Range, Mod) end),
                      Time = T - Overhead,
                      Percent =
                          case TMark of
                              warm_up   -> "(warm-up)";
                              undefined -> "   100.0%";
                              _ ->
                                  io_lib:format(
                                    "~8.1f%", [(Time * 100 + 50) / TMark])
                          end,
                      io:format(
                        "~.24w: ~8.1f ns ~s [16#~.16b]~n",
                        [Alg, (Time * 1000 + 500) / ?LOOP_MEASURE,
                         Percent, Range]),
                      Parent ! {self(), Time},
                      normal
              end),
      receive
  	{Pid, Msg} -> Msg
      end.
  
  %% Comparison algorithm for rand:bytes_s/2 vs. crypto:strong_rand_bytes/1
  
negative.code:                 <<Part/binary, (crypto:strong_rand_bytes(N * 16))/binary>>,
              {Bytes, Rest}
      end;
  bytes_s(N, undefined = St) ->
      %% crypto_bytes
      {crypto:strong_rand_bytes(N), St}.
  
  