Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *buffer = (char *) malloc(1024*50);
- int bytesrec = 0;
- LONGLONG bytesrec_sum = 0;
- LONGLONG start = GetSystemTimeInMS();
- do {
- bytesrec = recv(Socket, buffer, sizeof(buffer), MSG_WAITALL);
- bytesrec_sum += bytesrec;
- if (bytesrec > 0) {
- //DownloaderThread_WriteData(buffer, bytesrec);
- if (((float)bytesrec_sum/1024/1024/5) == (float)(bytesrec_sum/1024/1024/5)) {
- LONGLONG end = GetSystemTimeInMS();
- int diff = (end-start)/1000;
- 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));
- }
- }
- } while (bytesrec > 0);
Advertisement
Add Comment
Please, Sign In to add comment