From e10385909c687590d6522d007bba9d72f3f5c380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erland=20Sch=C3=B6nbeck?= Date: Tue, 24 Mar 2015 13:52:07 +0100 Subject: inets: Add new module inets_time_compat with new time API The new module is backwards compatible. --- lib/inets/examples/httpd_load_test/hdlt_random_html.erl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lib/inets/examples/httpd_load_test') diff --git a/lib/inets/examples/httpd_load_test/hdlt_random_html.erl b/lib/inets/examples/httpd_load_test/hdlt_random_html.erl index c55de628c1..59073a3d23 100644 --- a/lib/inets/examples/httpd_load_test/hdlt_random_html.erl +++ b/lib/inets/examples/httpd_load_test/hdlt_random_html.erl @@ -19,7 +19,6 @@ %% -module(hdlt_random_html). --compile([{nowarn_deprecated_function,{erlang,now,0}}]). -export([page/3]). page(SessionID, _Env, Input) -> @@ -49,15 +48,10 @@ stop() -> ". content(WorkSim, SzSim) -> - %% Adapt to OTP 18 erlang time API and be backwards compatible - {A, B, C} = try - {erlang:phash2([node()]), - erlang:monotonic_time(), - erlang:unique_integer()} - catch - error:undef -> - erlang:now() - end, + {A, B, C} = {erlang:phash2([node()]), + inets_time_compat:monotonic_time(), + inets_time_compat:unique_integer()}, + random:seed(A, B, C), lists:sort([random:uniform(X) || X <- lists:seq(1, WorkSim)]), lists:flatten(lists:duplicate(SzSim, "Dummy data ")). -- cgit v1.2.3