ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-Linux difftime

To: "" <>
Subject: Re: [ts-7000] TS-Linux difftime
From: Walter Marvin <>
Date: Mon, 5 Dec 2011 08:45:10 -0800 (PST)


My experience is that not all libraries have all functions implimented. Get the source for the library you are using and see if this is not so.


From: Craig Gates <>
To:
Cc: Mike Dodd <>
Sent: Monday, December 5, 2011 10:43 AM
Subject: Re: [ts-7000] TS-Linux difftime

 
a google search for the keywords linux difftime  provided this as the second hit:

http://www.linuxquestions.org/questions/programming-9/c-difftime-returns-zero-188574/

google is your friend

regards,
Craig

On 12/4/11 7:41 PM, Mike Dodd wrote:
 
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





__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<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