Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
timer in emmeded linux
- 08-19-2006
- pareshvarshney
August 19, 2006, 11:45 am

Hi all,
I need to set timer in C/linux like alram, such that i will get a
timeout signal after specific timeout and my process remain executing
as is it.
I can use signal(SIGALRM, xyz) and then alarm(some value in sec), there
is a constraint in this as i can pass timeout only in seconds and i
need in milli sec.
Any idea how todo this.
Regards,
Paresh
I need to set timer in C/linux like alram, such that i will get a
timeout signal after specific timeout and my process remain executing
as is it.
I can use signal(SIGALRM, xyz) and then alarm(some value in sec), there
is a constraint in this as i can pass timeout only in seconds and i
need in milli sec.
Any idea how todo this.
Regards,
Paresh

Re: timer in emmeded linux

Pure Linux is not a real _hard_ time system. So _exact_ msec timers
can't be done. You might see a delay of several 100 msec (though only
very seldom).
If your need is only _soft_ realtime I suppose there are lots of ways to
use timers in Kernel and in user mode.
-Michael

Re: timer in emmeded linux

What's your hardware? There are free-running timers available on some
platforms - maybe all platforms. But again, they're not super-accurate.
It's easy enough to launch a watchdog thread to watch the free-running
timer while your other thread is doing something else.
--Yan

Re: timer in emmeded linux

Not really true. With Kernel 2.6 on PC you have a default of 1 mSec
ticks in the Kernel. Other Architectures have 10 mSec or something in
between. You can change this value in a .h file, but the value needs to
be chosen according to the hardware capabilities. In user space, 2.6
always uses 10 mSec ticks. Changing this (in the same .h file) is
discouraged.
But anyway, there is never a guarantee that a tick is really executed
timely. You can loose some, even in the Kernel.
-Michael
Site Timeline
- » problems with U-Boot bootloader, scrambled output
- — Next thread in » Embedded Linux
-
- » ls -l Vs df
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Unbekanntes LCD
- — The site's Newest Thread. Posted in » Electronics (German)
-
- » Re: Capacitors at RF
- — The site's Last Updated Thread. Posted in » Electronics Repair
-