struct timeval start, end;
gettimeofday(&start, NULL);
/*
* to calculate code
*/
gettimeofday(&end, NULL);
long long total_time = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);
// get the run time by microsecond
printf("total time is %lld us\n", total_time);
// get the run time by millisecond
total_time /= 1000;
printf("total time is %lld ms\n", total_time);
mount -t ramfs ramfs /home 把一部分内存当做硬盘来使用