Hi guys,
I am a newbie in C and I am having some problems about the numeric format, My code in C is:
Code:
inline long compute_delta(struct timeval* t2, struct timeval* t1) {
return ((long)(t2->tv_sec - t1->tv_sec)) * 1000000 +
(t2->tv_usec - t1->tv_usec);
}
#define LOG_EVERY_USEC 1000000
//printf("DELTA %ld\n", compute_delta(&t2, &tlast));
if(compute_delta(&t2, &tlast) > LOG_EVERY_USEC) {
fprintf(stdout, "received = %ld, throughput (b/s) = %ld\n",
totreceived,
((8 * totreceived * 1000000L) / compute_delta(&t2, &tstart)));
fflush(stdout);
tlast = t2;
}
in x86 Architecture I have the results:
received = 107321084, throughput (b/s) = 855028001
received = 222587106, throughput (b/s) = 875168194
received = 337852114, throughput (b/s) = 881820801
received = 453118704, throughput (b/s) = 884694650
in ARM architecture is different:
received = 7954626, throughput (b/s) = -1323
received = 19879344, throughput (b/s) = 310
received = 31802412, throughput (b/s) = -502
received = 43726706, throughput (b/s) = 329
received = 55651424, throughput (b/s) = -114
received = 67574492, throughput (b/s) = 198
The code is the same in both architectures.
Thanks Guys.