duration</code>.</p>
<p>Use this with care, as no asynchronous operations can be processed
in a isolate while it is blocked in a <a href="dart-io/sleep.html">sleep</a> call.</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">void sleep(Duration duration) {
  int milliseconds = duration.inMilliseconds;
  if (milliseconds &lt; 0) {
    throw new ArgumentError(&quot;sleep: duration