add memory write speed test.

This commit is contained in:
gardners 2013-10-22 12:53:34 -07:00
parent 17d2dda6ae
commit 6ff2ae4871

View File

@ -2509,10 +2509,20 @@ int app_mem_test(const struct cli_parsed *parsed, struct cli_context *context)
addr=random()&mem_mask;
total+=mem[addr];
}
printf("Memory size = %8dKB : %lld random reads per second (irrelevant sum is %016llx)\n",mem_size/1024,count,
printf("Memory size = %8dKB : %lld random reads per second (irrelevant sum is %016llx)\n",mem_size/1024,count*10,
/* use total so that compiler doesn't optimise away our memory accesses */
total);
end_time=gettime_ms()+100;
for(count=0;gettime_ms()<end_time;count++) {
addr=random()&mem_mask;
mem[addr]=3;
}
printf("Memory size = %8dKB : %lld random writes per second (irrelevant sum is %016llx)\n",mem_size/1024,count*10,
/* use total so that compiler doesn't optimise away our memory accesses */
total);
free(mem);
}
return 0;