Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LokeshKumarES/c0e29998e8ea7acfa0ea9279874e4455 to your computer and use it in GitHub Desktop.
Save LokeshKumarES/c0e29998e8ea7acfa0ea9279874e4455 to your computer and use it in GitHub Desktop.
Lets compare the compilation time for all the four storage classes of variable in c.
//Static Storage Class Variable
//Speed Test
#include<stdio.h>
#include<time.h>
int main()
{
static int i;
for(i=1;i<=100000000;i++);
int ticks=clock();
printf("%f\n",(float)ticks/CLOCKS_PER_SEC);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment