[erlang-questions] Unexpected behaviour of timer:sleep

shehan shehan@REDACTED
Wed Mar 19 11:35:54 CET 2008


timer:sleep(1) means 1 millisecond hold the process. But 15000 mean 15
milliseconds.  In old Erlang version (5.5.5) it is came as expected.(pls see
below)  15000 come in Erlang 5.6 version. 

 

In Erlang 5.5.5

==========

1> timer:tc(timer, sleep, [1]).
{1643,ok}
2> timer:tc(timer, sleep, [2]).
{2553,ok}
3> timer:tc(timer, sleep, [7]).
{7393,ok}

 

  _____  

From: Chandru [mailto:chandrashekhar.mullaparthi@REDACTED] 
Sent: Wednesday, March 19, 2008 3:26 PM
To: shehan
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] Unexpected behaviour of timer:sleep

 

On 19/03/2008, shehan <shehan@REDACTED> wrote:

Hi all,

When I am running following command, unexpected value came as result. Why is
that??

 

(test@REDACTED)15> timer:tc(timer, sleep, [1]).  

{15000,ok}

I expected value is, between 1000 to 2000.


timer:tc returns the elapsed time in microseconds, so it is within your
expectation!

Chandru

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080319/c93aa667/attachment.htm>


More information about the erlang-questions mailing list