当前位置: 技术问答>linux和unix
单线程和多线程读取磁盘数据时间验证代码
来源: 互联网 发布时间:2017-04-23
本文导语: threadtest.c #include #include #include int main() { char str[][5]={"1.ts","2.ts","3.ts","4.ts","5.ts","6.ts","7.ts","8.ts","9.ts"}; pid_t pid; int i=0; clock_t start,end; start = clock(); for(;i
threadtest.c
#include
#include
#include
int main()
{
char str[][5]={"1.ts","2.ts","3.ts","4.ts","5.ts","6.ts","7.ts","8.ts","9.ts"};
pid_t pid;
int i=0;
clock_t start,end;
start = clock();
for(;i
#include
#include
#include
int main()
{
char str[][5]={"1.ts","2.ts","3.ts","4.ts","5.ts","6.ts","7.ts","8.ts","9.ts"};
pid_t pid;
int i=0;
clock_t start,end;
start = clock();
for(;i