B
bluekite2000
I ran the following code for a square matrix whose size ranges from 1x1
to 1000x1000
start=clock();
//sequential access time measurement
for (i=0;i<Msize;i++)
for(j=0;j<Nsize;j++)
{
Matrixj]=1;
}
finish=clock();
duration=(double)(finish-start);
The duration is all 0 tick from matrix 1x1 to 500x500 but then it jumps
suddenly to 10000 for matrix 501x501. I have 2 questions:
1. why the sudden jump?
2. How do I get some number more accurate than 0 tick?
Ps CLOCKS_PER_SEC=1000000 for my computer
to 1000x1000
start=clock();
//sequential access time measurement
for (i=0;i<Msize;i++)
for(j=0;j<Nsize;j++)
{
Matrixj]=1;
}
finish=clock();
duration=(double)(finish-start);
The duration is all 0 tick from matrix 1x1 to 500x500 but then it jumps
suddenly to 10000 for matrix 501x501. I have 2 questions:
1. why the sudden jump?
2. How do I get some number more accurate than 0 tick?
Ps CLOCKS_PER_SEC=1000000 for my computer