I wrote a C program that compiles and runs on a TS-7250 under Debian and
under TS-Linux, but difftime() doesn't operate correctly under TS-Linux.
Here is a test program:
---------------
struct tm *tp = NULL;
time_t t_now;
time_t t_last;
double elapsed_seconds;
t_last = time(NULL);
while(1)
{
t_now = time(NULL);
elapsed_seconds = difftime(t_now, t_last); // Get time through loop
t_last = t_now;
printf("t_now = %ld, t_last = %ld\n", t_now, t_last);
printf("elapsed_seconds = %1.1f\n", elapsed_seconds);
sleep(5);
}
---------------
Under Debian, I see the expected 5 seconds for elapsed_seconds each time
through the loop. But under TS-Linux, elapsed_seconds is always ZERO.
The t_last and t_now variables are being updated correctly -- 5 seconds
difference each time -- but the TS-Linux difftime () returns zero.
This is the exact-same code running on Debian and TS-Linux.
Anyone know what's going on?
Thanks for any pointers.
--
Mike
Mike Dodd
Louisa County, VA USA
http://mdodd.com
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|