summaryrefslogtreecommitdiff
path: root/lib/inets/examples
diff options
context:
space:
mode:
authorErland Schönbeck <erland@erlang.org>2015-03-24 13:52:07 +0100
committerErland Schönbeck <erland@erlang.org>2015-03-24 13:52:07 +0100
commite10385909c687590d6522d007bba9d72f3f5c380 (patch)
tree51227978bac92c6eb5f94c4bc20c2b9b7d1c396e /lib/inets/examples
parent487446e76102b27fa8df02a353c7fdeec2d091f1 (diff)
downloaderlang-e10385909c687590d6522d007bba9d72f3f5c380.tar.gz
inets: Add new module inets_time_compat with new time API
The new module is backwards compatible.
Diffstat (limited to 'lib/inets/examples')
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_random_html.erl14
1 files changed, 4 insertions, 10 deletions
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 ")).