Guest User

Untitled

a guest
Oct 5th, 2010
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1.        char *buffer = (char *) malloc(1024*50);
  2.        int bytesrec = 0;
  3.        LONGLONG bytesrec_sum = 0;
  4.        LONGLONG start = GetSystemTimeInMS();
  5.        do {
  6.            bytesrec = recv(Socket, buffer, sizeof(buffer), MSG_WAITALL);
  7.            bytesrec_sum += bytesrec;
  8.  
  9.            if (bytesrec > 0) {
  10.              //DownloaderThread_WriteData(buffer, bytesrec);
  11.  
  12.              if (((float)bytesrec_sum/1024/1024/5) == (float)(bytesrec_sum/1024/1024/5)) {
  13.                 LONGLONG end = GetSystemTimeInMS();
  14.                 int diff = (end-start)/1000;
  15.                 Log("Donwloaded MB: %.2Lf tooked time: %d Speed: %.4Lf MB/s", ((float)bytesrec_sum/1024/1024), diff, Round(((float)bytesrec_sum/1024/1024)/diff, 4));
  16.              }
  17.            }
  18.        } while (bytesrec > 0);
Advertisement
Add Comment
Please, Sign In to add comment