Created
November 5, 2020 13:49
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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