2013年5月29日星期三

timer wrap

http://yarchive.net/comp/linux/timer_wrapping_c.html

http://stackoverflow.com/questions/8206762/how-does-linux-handle-overflow-in-jiffies

http://stackoverflow.com/questions/8206762/how-does-linux-handle-overflow-in-jiffies

2013年5月16日星期四

NTP



通过date命令可直接现在的时间戳
# date +%s
1265851947
也可以得到指定时间的时间戳
# date -d "2007-07-30 9:30" +%s
1185759000
然后我们可以将它们转换为系统的时间格式
# date -d '1970-01-01 UTC 1265851947 sec' +"%F %T"
2010-02-11 09:32:27
# date -d '1970-01-01 UTC 1185759000 sec' +"%F %T"
2007-07-30 09:30:00

For example, open /etc/ntp.conf file using vi text editor:
# vi /etc/ntp.conf
Locate server parameter and set it as follows:
server pool.ntp.org
Save the file and restart the ntpd service:
# /etc/init.d/ntpd start
You can synchronize the system clock to an NTP server immediately with following command:
# ntpdate pool.ntp.org

2013年5月14日星期二

gcov: lots of EOF in gcov file

You have to run gcov in the same directory as the .cpp file, otherwise it
gives an error message about being unable to find it (even with a path.)  This
works:
 
 
python one 
http://nedbatchelder.com/code/coverage/branch.html 

2013年5月10日星期五

fast time in linux

http://fasttime.sourceforge.net/doc/internal.html
http://tsc-xluo.sourceforge.net/