title: Using TBB for an simple example
body: <p>I am new to <code>TBB</code> and try to do a simple exprement.</p>
  
  <p>My data for functions are:</p>
  
  <pre><code>int n = 9000000;
  int *data = new int[n];
  </code></pre>
  
  <p>I created a function, the first one without using <code>TBB</code>:</p>
  
  <pre><code>void _array(int* &amp;data, int n) {
          for (int i = 0; i &lt; n; i++) {
              data[i] = busyfunc(data[i])*123;
          }
  }
  </code></pre>
  
  <p><code>It takes 0.456635 seconds.</code></p>
  
  <p>And also created a to function, the first one with using <code>TBB</code>:</p>
  
  <pre><code>void parallel_change_array(int* &amp;data,int list_count) {
      //Instructional example - parallel version
      parallel_for(blocked_range&lt;int&gt;(0, list_count),
          [=](const blocked_range&lt;int&gt;&amp; r) {
          for (int i = r.begin(); i &lt; r.end(); i++) {
              data[i] = busyfunc(data[i])*123;
          }
      });
  }
  </code></pre>
  
  <p>It takes me <code>0.584889 seconds.</code></p>
  
  <p>As for busyfunc(int m):</p>
  
  <pre><code>int busyfunc(int m)
  {
      m *= 32;
      return m;
  }
  </code></pre>
  
  <p>Can you tell me, why the function without using <code>TBB</code> spends less time, than if it is with <code>TBB</code>? </p>
  
  <p>I think, the problem is that the functions are simple, and it's easy to calculate without using <code>TBB</code>.</p>