Re: Alert process every minute real time? - Thanks!



On Sat, 02 Sep 2006 09:52:26 -0700, Bill Pursell wrote:


Hadron Quark wrote:
Jan Panteltje <pNaonStpealmtje@xxxxxxxxx> writes:

On a sunny day (Sat, 02 Sep 2006 16:00:18 GMT) it happened Charles Sullivan
<cwsulliv@xxxxxxxxxxxx> wrote in
<pan.2006.09.02.16.00.17.630726@xxxxxxxxxxxx>:

A background process written in C language is expected to perform a
task each time the system clock rolls over to the next whole minute
of real time (+/- a second or two).

Is there any better way of alerting the process when this rollover
occurs other than a polling function which reads the system clock?

man 2 alarm

Is that what the OP is looking for? He wanted real time minute tick
over - different - e.g within a second of 3:59:59 -> 4:00:00


It doesn't give exactly what the OP requested, but it
certainly provides enough to do what was asked. (ie,
check the current time, calculate
the amount of time until the next minute, and then
set an alarm). I would recommend looking at
setitimer as well.

Thanks Jan, Hadron, and Bill for your responses.

What you've described is close to what I had in mind by "a polling
function which reads the system clock".

What I was wondering is whether there might be a generic system
function I was unaware of whose prototype is something like this:
void set_alarm_to_go_off_at( time_t alert_time );

I guess there isn't, and it will be up to me to write one using
the methods you guys have described.

Thanks again.

Regards,
Charles Sullivan




.



Relevant Pages

  • Re: Alert process every minute real time?
    ... task each time the system clock rolls over to the next whole minute ... of real time. ... There is an example how to use alarm() in /usr/info/libc.info ... void catch_alarm (int sig) ...
    (comp.os.linux.development.apps)
  • Re: Countdown program - Exercise 5
    ... If you want a countdown of several hours, rather than ten seconds, ... > But another very real problem is deviation from real time. ... > do some syncing with the system clock to get a meaningful time displayed. ... the system time in milliseconds of the Posix Epoch: ...
    (comp.lang.tcl)
  • Re: Something strange happened to System Clock
    ... It simply means that your system clock is tracking ... > the real time well and adjustments converge towards zero. ... I stopped running xntpd days before, ... > drift file, causing the daemon not to be able to note down the ...
    (alt.os.linux.suse)
  • Re: REALTIME APP
    ... What exactly do you mean by "real time"? ... The system clock in CE is often set to have 1 second intervals. ... All that said, if you're needing a real-time system, managed code is *not* ... > support a clock precision best than XP's. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Alert process every minute real time?
    ... task each time the system clock rolls over to the next whole minute ... of real time. ... man 2 alarm ... void catch_alarm (int sig) ...
    (comp.os.linux.development.apps)