aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test/snmp_log_test.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/test/snmp_log_test.erl')
-rw-r--r--lib/snmp/test/snmp_log_test.erl29
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl
index fb7285110f..ed71dba23f 100644
--- a/lib/snmp/test/snmp_log_test.erl
+++ b/lib/snmp/test/snmp_log_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -633,11 +633,11 @@ log_to_txt3(Config) when is_list(Config) ->
log_reader_log_to(Reader,
fun() ->
I = disk_log:info(Log),
- T1 = t(),
+ T1 = snmp_misc:now(ms),
R = snmp_log:log_to_txt(Log, LogFile, Dir,
Mibs, TxtFile),
- T2 = t(),
- io:format(user,
+ T2 = snmp_misc:now(ms),
+ io:format(user,
"Time converting file: ~w ms~n",
[T2 - T1]),
{R, I}
@@ -704,10 +704,10 @@ log_writer_start(Name, File, Size, Repair) ->
log_writer_stop(Pid) ->
Pid ! {stop, self()},
- _T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{'EXIT', Pid, normal} ->
- _T2 = t(),
+ _T2 = snmp_misc:now(ms),
?DBG("it took ~w ms to stop the writer", [_T2 - _T1]),
ok
after 60000 ->
@@ -721,10 +721,10 @@ log_writer_info(Pid) ->
log_writer_sleep(Pid, Time) ->
Pid ! {sleep, Time, self()},
- _T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{sleeping, Pid} ->
- _T2 = t(),
+ _T2 = snmp_misc:now(ms),
?DBG("it took ~w ms to put the writer to sleep", [_T2 - _T1]),
ok;
{'EXIT', Pid, Reason} ->
@@ -793,10 +793,10 @@ lp(F, A) ->
log_reader_start() ->
Pid = spawn_link(?MODULE, log_reader_main, [self()]),
- _T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{started, Pid} ->
- _T2 = t(),
+ _T2 = snmp_misc:now(ms),
?DBG("it took ~w ms to start the reader", [_T2 - _T1]),
{ok, Pid};
{'EXIT', Pid, Reason} ->
@@ -807,10 +807,10 @@ log_reader_start() ->
log_reader_stop(Pid) ->
Pid ! {stop, self()},
- _T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{'EXIT', Pid, normal} ->
- _T2 = t(),
+ _T2 = snmp_misc:now(ms),
?DBG("it took ~w ms to put the reader to eleep", [_T2 - _T1]),
ok
after 1000 ->
@@ -1124,8 +1124,3 @@ join(D, F) ->
p(Case) ->
io:format(user, "test case: ~w~n", [Case]).
-
-%% Time in milli sec
-t() ->
- {A,B,C} = erlang:now(),
- A*1000000000+B*1000+(C div 1000).