benchmark

This commit is contained in:
Carl-Benedikt Krüger 2011-07-05 12:58:17 +02:00
parent 3490e38400
commit 4d83de57af

View file

@ -151,7 +151,7 @@ void* server_task(void* e)
char buffer[256];
struct sockaddr_in serv_addr, cli_addr;
int n;
unsigned int tmp1,tmp2;
uint64_t tmp1,tmp2;
/* First call to socket() function */
sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@ -214,12 +214,12 @@ void* server_task(void* e)
tmp1 = get_clock_tick();
for (n = 0; n < 1024*1024*100/256 ; n++)
for (n = 0; n < 1024*1024 ; n++)
send(newsockfd,buffer,sizeof(buffer),0);
tmp2 = get_clock_tick();
kprintf("Send 100 MB in : %d clock ticks",tmp2-tmp1);
kprintf("Send 256 MB in : %d clock ticks",tmp2-tmp1);
return 0;
}
@ -270,7 +270,7 @@ void* client_task(void* e)
/* spew-out the results and bail out of here! */
kprintf("%s\n", dir);
for (n = 0; n < 1024*1024*100/256 ; n++)
for (n = 0; n < 1024*1024 ; n++)
recv(sd,dir,sizeof(dir),0);
close(sd);