question about algorithm complexity
<p>i  have tried   implement two methods recursive and dynamic method and both took 0 second it means that  no one is better in my computer or something is wrong in code? here is  these methods</p>

<p>1// recursive</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;time.h&gt;
#include &lt;iostream&gt;
using std::cout;
void print(int  n){

    if (n&lt;0)  return ;
    cout&lt;&lt;n&lt;&lt;" ";

    print(n-1);

}
int main(){
    int n=10;
    time_t  start,end;
    double dif;
    time(&amp;start);
    print(n);
    time(&amp;end);
    dif=difftime(end,start);
    printf("it took you %.21f seconds ",dif);

     return 0;
}
</code></pre>

<p>2.second method</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;time.h&gt;
using namespace std;
void print (int n){
    if (n&lt;0) return ;
     while (n&gt;=0){
         cout&lt;&lt;n--&lt;&lt;endl;
     }



}
int main(){
    int n=10;
    double dif;
    time_t start,end;
    time(&amp;start);

    print(n);
    time(&amp;end);
    dif=difftime(end,start);
    printf("it took you %.21f seconds",dif);

 return 0;

}
</code></pre>
