Skip to main content
added 70 characters in body
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 9

C 134134 133 bytes

Thanks to @Thomas Padron-McCarthy for saving 1 byte.

f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}

Ungolfed version :

void f()
{   
  clock_t s,e;

  s=clock();

  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);   
  
  e=clock();
  printf("%lf""%f",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);

 }

C 134 bytes

f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}

Ungolfed version :

void f()
{   
  clock_t s,e;

  s=clock();

  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);   
  
  e=clock();
  printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);

 }

C 134 133 bytes

Thanks to @Thomas Padron-McCarthy for saving 1 byte.

f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}

Ungolfed version :

void f()
{   
  clock_t s,e;

  s=clock();

  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);   
  
  e=clock();
  printf("%f",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);

 }
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 9

C 134 bytes

f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}

Ungolfed version :

void f()
{   
  clock_t s,e;

  s=clock();

  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);   
  
  e=clock();
  printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);

 }