title: Make a process sleep for a random time - Erlang
body: <p>I would like to use the sleep function of the timer class and I would like to use it to make a process sleep for a random amount of time in between 0 and 1.</p>
  
  <p>In order to do this, I tried:</p>
  
  <pre><code>timer:sleep(random:uniform()).
  </code></pre>
  
  <p>However, i get the following error message:</p>
  
  <pre><code>=ERROR REPORT==== 1-Apr-2014::21:39:32 ===
  Error in process &lt;0.472.0&gt; with exit value: {timeout_value,[{timer,sleep,1,       
  [{file,"timer.erl"},{line,152}]},{myModule,myFunction,4,[{file,"myModule.erl"},
  {line,46}]}]}
  </code></pre>
  
  <p>What is wrong with this?  </p>
  
  <p>Also, as I have multiple versions of the same process, how can I make sure that each start with a different random number?</p>