Wed May 17 16:37:53 CEST 2006
I've been testing the timer:sleep/1 function and I have some troubles with some values passed to the function. In the test I start n process and each process make a loop sleeping for x milliseconds. Below I show the example.
If I run the test with sleepTest:start(100, 999) the test work fine, but if I run with sleepTest(100, 1000) the erlang process consume 100% cpu :(
Is this a bug? Why with 999 milliseconds work fine and with 1000 milliseconds no?
In ran the test in a Windows XP with Erlang v5.4
start(0, _Sleep) ->
start(N, Sleep) ->
spawn(fun() -> loop(Sleep) end),
start(N - 1, Sleep).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions