Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to deal with time in C ?

Reply
Thread Tools

How to deal with time in C ?

 
 
srikanth
Guest
Posts: n/a
 
      06-17-2005
i have written one C -programm, which outputs signals for specific
input. what my question is, i want to produce outputs for some range of
user inputs. so for this i want to call my programm for every 40ms.
Before, i never dealed with time.

my software is running with linux operation system on a HIL simulator.
- Processor is little endian
- Boot from flash
- Input clock frequency for Excalibur is 20MHz
- SDRAM clock frequency is 133MHz.

Using C-libraries is it possible to get time from any processor??
Could any one please suggest how to proceed for my problem??

Thank you,

srikanth.

 
Reply With Quote
 
 
 
 
Jean-Claude Arbaut
Guest
Posts: n/a
 
      06-17-2005

> Using C-libraries is it possible to get time from any processor??
> Could any one please suggest how to proceed for my problem??



It's probably not related to the C laguage itself. Maybe
you can have a look at the POSIX standard. Start here:

http://www.unix.org/single_unix_specification/

The "time" function is described here:

http://www.opengroup.org/onlinepubs/...ions/time.html

 
Reply With Quote
 
 
 
 
pete
Guest
Posts: n/a
 
      06-17-2005
Jean-Claude Arbaut wrote:
>
> > Using C-libraries is it possible to get time from any processor??
> > Could any one please suggest how to proceed for my problem??

>
> It's probably not related to the C laguage itself. Maybe
> you can have a look at the POSIX standard. Start here:


Try harder.

N869
7.23 Date and time <time.h>
7.23.1 Components of time
[#1] The header <time.h> defines four macros, and declares
several types and functions for manipulating time.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n869/

--
pete
 
Reply With Quote
 
Jean-Claude Arbaut
Guest
Posts: n/a
 
      06-17-2005



Le 17/06/2005 14:26, dans http://www.velocityreviews.com/forums/(E-Mail Removed), «*pete*»
<(E-Mail Removed)> a écrit*:

> Jean-Claude Arbaut wrote:
>>
>>> Using C-libraries is it possible to get time from any processor??
>>> Could any one please suggest how to proceed for my problem??

>>
>> It's probably not related to the C laguage itself. Maybe
>> you can have a look at the POSIX standard. Start here:

>
> Try harder.




I give up !


> N869
> 7.23 Date and time <time.h>
> 7.23.1 Components of time
> [#1] The header <time.h> defines four macros, and declares
> several types and functions for manipulating time.
>
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n869/


 
Reply With Quote
 
Mehta Shailendrakumar
Guest
Posts: n/a
 
      06-17-2005
Hi,

You can use functions alarm() or setitimer(),getitimer() etc.
They are available in linux.

Regards,
Shailendra

"srikanth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> i have written one C -programm, which outputs signals for specific
> input. what my question is, i want to produce outputs for some range of
> user inputs. so for this i want to call my programm for every 40ms.
> Before, i never dealed with time.
>
> my software is running with linux operation system on a HIL simulator.
> - Processor is little endian
> - Boot from flash
> - Input clock frequency for Excalibur is 20MHz
> - SDRAM clock frequency is 133MHz.
>
> Using C-libraries is it possible to get time from any processor??
> Could any one please suggest how to proceed for my problem??
>
> Thank you,
>
> srikanth.
>



 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      06-17-2005
pete wrote:

> Jean-Claude Arbaut wrote:
>
>>>Using C-libraries is it possible to get time from any processor??
>>>Could any one please suggest how to proceed for my problem??

>>
>>It's probably not related to the C laguage itself. Maybe
>>you can have a look at the POSIX standard. Start here:

>
>
> Try harder.
>
> N869
> 7.23 Date and time <time.h>
> 7.23.1 Components of time
> [#1] The header <time.h> defines four macros, and declares
> several types and functions for manipulating time.


Unfortunately, the <time.h> facilities will not meet the
O.P.'s need, which is for a recurring execution with a 40-ms
period. As Jean-Claude said, he'll need to go beyond Standard
C to achieve this.

--
Eric Sosman
(E-Mail Removed)lid
 
Reply With Quote
 
Materialised
Guest
Posts: n/a
 
      06-17-2005

"srikanth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> i have written one C -programm, which outputs signals for specific
> input. what my question is, i want to produce outputs for some range of
> user inputs. so for this i want to call my programm for every 40ms.
> Before, i never dealed with time.
>
> my software is running with linux operation system on a HIL simulator.
> - Processor is little endian
> - Boot from flash
> - Input clock frequency for Excalibur is 20MHz
> - SDRAM clock frequency is 133MHz.
>
> Using C-libraries is it possible to get time from any processor??
> Could any one please suggest how to proceed for my problem??
>
> Thank you,
>
> srikanth.
>

Thought about using crontab?


 
Reply With Quote
 
Mac
Guest
Posts: n/a
 
      06-17-2005
On Fri, 17 Jun 2005 04:54:15 -0700, srikanth wrote:

> i have written one C -programm, which outputs signals for specific
> input. what my question is, i want to produce outputs for some range of
> user inputs. so for this i want to call my programm for every 40ms.
> Before, i never dealed with time.
>
> my software is running with linux operation system on a HIL simulator.
> - Processor is little endian
> - Boot from flash
> - Input clock frequency for Excalibur is 20MHz
> - SDRAM clock frequency is 133MHz.
>
> Using C-libraries is it possible to get time from any processor??
> Could any one please suggest how to proceed for my problem??
>
> Thank you,
>
> srikanth.


Please don't cross-post to comp.lang.c and comp.lang.c++. This is RARELY
productive.

In this case, I believe your question is off-topic in both groups. Perhaps
a group dedicated to the system you are using would be a better choice. If
there is no such group, then maybe a mailing list?

In general, I think it is impossible to guarantee deterministic periodic
operation unless you have a real-time OS, but maybe I'm wrong, somehow.

For more information about comp.lang.c, see the faq:
http://www.eskimo.com/~scs/C-faq/top.html

You can also read this welcome message:
http://www.ungerhu.com/jxh/clc.welcome.txt

I'm sure there are similar resources for comp.lang.c++, but I don't know
where to find them.

--Mac

 
Reply With Quote
 
Anonymous 7843
Guest
Posts: n/a
 
      06-17-2005
In article <(E-Mail Removed)>,
Materialised <(E-Mail Removed)> wrote:
>
>"srikanth" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed) oups.com...
>> i have written one C -programm, which outputs signals for specific
>> input. what my question is, i want to produce outputs for some range of
>> user inputs. so for this i want to call my programm for every 40ms.
>> Before, i never dealed with time.
>> ...

>Thought about using crontab?


Pls note the bit where he says 40ms.
--
7842++
 
Reply With Quote
 
Gordon Burditt
Guest
Posts: n/a
 
      06-17-2005
>> Using C-libraries is it possible to get time from any processor??
>> Could any one please suggest how to proceed for my problem??
>>
>> Thank you,
>>
>> srikanth.
>>

>Thought about using crontab?


You want the OP to use crontab to invoke something every 40
MILLISECONDS? The implementations of crontab I've seen don't even
let you specify seconds. You can do once a minute.

Gordon L. Burditt
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
how to deal with "delay time" when photographing shoemakerted@yahoo.com Digital Photography 9 08-06-2007 04:11 PM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
AMD64 or Semperon, deal or no deal? Tad Confused Computer Information 7 04-13-2006 05:43 PM
deal or no deal rbt Python 7 12-28-2005 08:57 PM



Advertisments