|
@@ -54,11 +54,24 @@ testn(T) -> % T -- умовно секунди - кількість циклів
|
|
|
end),
|
|
|
|
|
|
spawn(fun() ->
|
|
|
+ io:format("count before: ~p~n", [myapp_events2:check_ets_count()]),
|
|
|
T1 = erlang:system_time(millisecond),
|
|
|
testn_h(T rem 2 =:= 0),
|
|
|
T2 = erlang:system_time(millisecond),
|
|
|
- io:format("~p~n",[T2 - T1]),
|
|
|
- ok
|
|
|
+ io:format("count after: ~p~n", [myapp_events2:check_ets_count()]),
|
|
|
+ io:format("~p milliseconds~n==========================================~n",[T2 - T1]),
|
|
|
+
|
|
|
+ case T of
|
|
|
+ 1 ->
|
|
|
+ % check count 5 sec after
|
|
|
+ spawn(fun() ->
|
|
|
+ timer:sleep(5000),
|
|
|
+ io:format("result count: ~p~n", [myapp_events2:check_ets_count()])
|
|
|
+ end),
|
|
|
+ ok;
|
|
|
+ _ -> ok
|
|
|
+ end
|
|
|
+
|
|
|
end),
|
|
|
ok.
|
|
|
|
|
@@ -103,11 +116,24 @@ testn_b(T) -> % T -- умовно секунди - кількість циклі
|
|
|
end),
|
|
|
|
|
|
spawn(fun() ->
|
|
|
+ io:format("count before: ~p~n", [myapp_events2:check_ets_count()]),
|
|
|
T1 = erlang:system_time(millisecond),
|
|
|
testn_h2(T rem 2 =:= 0),
|
|
|
T2 = erlang:system_time(millisecond),
|
|
|
- io:format("~p~n",[T2 - T1]),
|
|
|
- ok
|
|
|
+ io:format("count after: ~p~n", [myapp_events2:check_ets_count()]),
|
|
|
+ io:format("~p milliseconds~n==========================================~n",[T2 - T1]),
|
|
|
+
|
|
|
+ case T of
|
|
|
+ 1 ->
|
|
|
+ % check count 5 sec after
|
|
|
+ spawn(fun() ->
|
|
|
+ timer:sleep(5000),
|
|
|
+ io:format("result count: ~p~n", [myapp_events2:check_ets_count()])
|
|
|
+ end),
|
|
|
+ ok;
|
|
|
+ _ -> ok
|
|
|
+ end
|
|
|
+
|
|
|
end),
|
|
|
ok.
|
|
|
|