Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-28-2006, 01:45 AM   #1
LQ Newbie
Registered: Jun 2005
Posts: 10

Rep: Reputation: 0
Synchronising system clock to UTC while using a timer

I am using a linux timer:


and setting up the timer to fire first at the half second of the current second and then every second afterwards:

AbsTimer.it_value.tv_sec = TimeNow.tv_sec;
AbsTimer.it_value.tv_nsec = 500 000 000;
AbsTimer.it_interval.tv_sec = 1;

Now if I choose to update the system clock, using another function to synchronise it to UTC what happens to this current timer, will it next fire at the half second again and then every second after, or will the timer need to be closed, and re-initialised?

Here is what I see happening
timer fires at .5sec, 1.5 sec, 2.5sec, 3.5sec etc...
Function to synchronise comes along at some point before the timer fires ie between .5 and 1.5, and changes the clock to 5.00sec. (for example) Will the timer then fire half a sec later? or a full second later?

Andy O


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting system time to UTC triley Linux - General 2 08-25-2009 07:56 PM
clock timer problem Half_Elf Linux - General 2 10-02-2004 05:19 PM
System Clock UTC Whatever.. berkay Linux - Newbie 3 09-24-2004 01:29 AM
synchronising system time with an atom clock schatoor Linux - Software 2 05-13-2003 07:58 AM
my clock is UTC??? mathfeel Linux - General 2 08-16-2002 08:42 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration