From: | Yves Grabowsky |
Date: | 04 Dec 99 at 11:17:32 |
Subject: | cps counter |
From: YvesGrabowsky@t-online.de (Yves Grabowsky)
Hi,
I'm trying to calculate the cps of a transfer with the following code:
--------CUT HERE-----------
long n, temp, cps;
time_t start, current;
start = time(&start);
do
{
n = Sock_Recv(dtc, buf, LEN_RECVBUF);
temp += n;
if (n>0)
Write(outfile, buf, n);
current = time(¤t); // cps calculation
current -= start;
cps = temp/current;
} while(n); // receive loop
(temp holds the bytes received)
-----------CUT HERE-------------
Everytime I execute this code it crashes, without the cps calculation it
runs perfectly. Whats wrong with this?
Cu,