anchor.diff:  handle_cast(_Request, State) ->
       {noreply, State}.
   
  -terminate(_Reason, _State) -> ok.
  -code_change(_OldVsn, State, _Extra) -> {ok, State}.
  -format_status(_Opt, [_PDict, _State]) -> ok.
  +handle_info(next_event, #state{wait=Wait}) ->
  +    Ran = random:uniform(),         % 0..1
  +    X = round(50*Ran),              % bad code causing 1/0
  +    {_,Sec,_} = os:timestamp(),     % {MegaSec,Sec,MicroSec} since epoch
  +    FX = X * (Sec rem 100 + 1),     % rampy sample distribution
  +    OneOverX = 5000.0/X,            % spiky sample distribution
  +    imem_test_writer:write_test_record(X,FX,OneOverX,integer_to_list(fac(X))),
  +    erlang:send_after(Wait, self(), next_event),
  +    {noreply, #state{wait=Wait}}.
   
  -%% -endif.
  -
  -
  -%% -----------------------------------------------------------------------------
  -%% -define(ddTestName,ddTest_100@).   %% time partitioned 100 seconds / ,{purge_delay,500}
   
   % -record(state1, % fibonacci state
   %                 { wait = 1000                ::integer()
   %                 , fib_2 = 0                  ::integer()
   %                 , fib_1 = 1                  ::integer()
  -%                 , n = 2                       ::integer()
  +%                 , n = 2                      ::integer()
   %                 }).
   
  -% handle_info(write_record, #state{}) ->
  +% handle_info(next_event, #state{}) ->
   %     imem_test_writer:write_test_record(0,0,0.0,"fib start"),
   %     imem_test_writer:write_test_record(1,1,1.0,"fib next"),
  -%     handle_info(write_record, #state1{wait=1000,fib_2=0,fib_1=1,n=2});
  -% handle_info(write_record, #state1{wait=Wait,fib_2=L2,fib_1=L1,n=N}) ->
  +%     handle_info(next_event, #state1{wait=1000,fib_2=0,fib_1=1,n=2});
  +% handle_info(next_event, #state1{wait=Wait,fib_2=L2,fib_1=L1,n=N}) ->
   %     imem_test_writer:write_test_record(N,L2+L1,1.0/N,"fib next"),
  -%     erlang:send_after(Wait, self(), write_record),
  +%     erlang:send_after(Wait, self(), next_event),
   %     {noreply, #state1{wait=Wait,fib_2=L1,fib_1=L2+L1,n=N+1}}.
   
   % handle_call({wait, Wait}, _From, #state1{}=State) ->
   %     {reply, ok, State#state1{wait=Wait}}.
  +
  +% -endif.
  
positive.code: -module(imem_test_writer).
  
  %% -ifdef(TEST).
  
  -include("imem.hrl").
  -include("imem_meta.hrl").
  
  -behavior(gen_server).
  
  -record(ddTest,   %% test table    
                    { time      ::ddTimestamp()
                    , x         ::integer()
                    , fX        ::integer()
  
negative.code:         , format_status/2
          ]).
  
  start(Wait) ->
      % gen_server:start({local, ?MODULE}, ?MODULE, Wait, []).
      ChildSpec = { imem_test_writer                      % ChildId
                  , {imem_test_writer,start_link,[Wait]}  % {M,F,A}
                  , permanent                             % Restart strategy
                  , 1000                                  % Shutdown timeout
                  , worker                                % Type
                  , [imem_test_writer]                    % Modules
                  },
      supervisor:start_child(imem_sup, ChildSpec).
  
  stop() ->
      % gen_server:call(?MODULE, stop).
      supervisor:terminate_child(imem_sup, imem_test_writer),
      supervisor:delete_child(imem_sup, imem_test_writer).
  
  