![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Clock in Unix using awk | alex_omul | UNIX for Dummies Questions & Answers | 4 | 04-02-2008 03:07 AM |
| clock change | markab2 | UNIX for Advanced & Expert Users | 0 | 10-31-2007 04:58 AM |
| how to differentiate system call from library call | muru | UNIX for Advanced & Expert Users | 2 | 07-19-2007 08:20 PM |
| clock() function | kastrup_carioca | High Level Programming | 5 | 06-13-2005 07:05 AM |
| Why don't my clock show am or pm? | CTroxtell21 | Linux | 2 | 11-13-2004 06:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
clock() call returning zero always
Hi,
Is there a chance that the clock() call returns 0 eternally??? Using BSD. My RTOS application freezes inconsistently only on particular hosts. When debugging it, I came to see that the RTOS timer does not tick at times. The underlying system call is clock() & it always returns zero when the problem under question occurs. Consequently the RTOS timer does not tick or go further in time. Is it possible that some patches are missing on the hosts where my RTOS applications freeze? If so, how do I find out which patches are missing based on the given info? I guess clock() call does wrap after certain time (36 minutes approx). But I do not think it will return 0 for a long time... |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
clock() is subroutine, not a system call on FreeBSD. And the man page says:
Quote:
|
|
#3
|
|||
|
|||
|
If you are strictly interested in cpu time in user mode and/or kernel mode, consider times().
|
|
#4
|
|||
|
|||
|
I actually use the RTOS timer already written by a third party. clock() is used by them & it has been in use for five years now, no problems for long. Only recently the RTOS applications started freezing inconsistently when run on certain Faster Hosts with SunFire V215, 2 CPU.
The chances that I can modify the timer functionality immediately is low. I want to check if it's clock that is faulty or something else? And if it clock() that is faulty, do you have any hint of suitable patch that can correct it? |
|
#5
|
||||
|
||||
|
clock() is probably working correctly. Your third party assumed that some code would consume enough cpu time to register as non-zero when measured by clock(). You now have a CPU where this is not true. Induce the third party to fix the app or get some slower CPU's. Be warned though, the day will come when there are no CPU's available that are slow enough to run your app.
Wow, though! You are running BSD on a SunFire V215! That's pretty awesome. What version of BSD? |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|