On Jan 6, 2008 5:20 AM, Nico Heinze <[EMAIL PROTECTED]> wrote:
> --- In [email protected], Gopi Krishna Komanduri
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi Frnds,
> > I strucked up with some very basic and simple prog.
> > Could anyone of you please help me out. I need to write a
> > code in such a way that , The code should call a function
> > which prints some random number for every 10 seconds.
> > The issue what I am facing is once the control; goes into
> > function , initially I can get the starting time. But I
> > am unable to solve how my system will lemme know after
> > 10 seconds. I don't want to implement threads concept.
> > I don't want to ping time for every moment ( for
> > optimisation purpose) .
>
> That requires you to first tell us what OS you work with, what
> compiler, what IDE. Only then we can give you any educated advice.
>
> For example, if you work with a console application for Unix/Linux,
> then you don't have much of a choice but to implement a multi-threaded
> application; at least not that I know of.
I'd use SIGALRM and alarm() on Linux. No need for threading.
-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi