aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/misc/snmp_misc.erl
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2015-04-24 12:56:39 +0200
committerErland Schönbeck <[email protected]>2015-04-24 12:56:39 +0200
commite5228853fd16f9817bc26a82730c697fc0ecdf34 (patch)
tree401a385a01f6bdec013d6a167caaef216467309e /lib/snmp/src/misc/snmp_misc.erl
parentc46ae84ffd858c8fa8ddb3bfbfb3607276173fb4 (diff)
downloadotp-e5228853fd16f9817bc26a82730c697fc0ecdf34.tar.gz
otp-e5228853fd16f9817bc26a82730c697fc0ecdf34.tar.bz2
otp-e5228853fd16f9817bc26a82730c697fc0ecdf34.zip
snmp: Change to random use crypto. Remove use of erlang:now
Diffstat (limited to 'lib/snmp/src/misc/snmp_misc.erl')
-rw-r--r--lib/snmp/src/misc/snmp_misc.erl23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/snmp/src/misc/snmp_misc.erl b/lib/snmp/src/misc/snmp_misc.erl
index c36cee2a53..cc438977c9 100644
--- a/lib/snmp/src/misc/snmp_misc.erl
+++ b/lib/snmp/src/misc/snmp_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-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
@@ -101,21 +101,14 @@ sleep(Time) ->
%% Returns time in ms = sec/1000
% now() -> now(ms).
now(ms) ->
- Now = erlang:now(),
- element(1,Now)*1000000000+
- element(2,Now)*1000+
- (element(3,Now) div 1000);
+ erlang:monotonic_time(milli_seconds);
+
%% Returns time in cs = sec/100
now(cs) ->
- Now = erlang:now(),
- element(1,Now)*100000000+
- element(2,Now)*100+
- (element(3,Now) div 10000);
+ erlang:monotonic_time(100);
+
now(sec) ->
- Now = erlang:now(),
- element(1,Now)*1000000+
- element(2,Now)+
- (element(3,Now) div 1000000).
+ erlang:monotonic_time(seconds).
is_crypto_supported(Alg) ->
@@ -479,7 +472,3 @@ format_val('OBJECT IDENTIFIER', _, Val, MiniMib) ->
io_lib:format("~w", [NVal]);
format_val(_, _, Val, _MiniMib) ->
io_lib:format("~p", [Val]).
-
-
-
-