ts-7000
[Top] [All Lists]

[ts-7000] TS-Linux difftime

To:
Subject: [ts-7000] TS-Linux difftime
From: Mike Dodd <>
Date: Sun, 04 Dec 2011 22:41:11 -0500
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/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU