LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-14-2005, 08:44 AM   #1
bndpatel
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Rep: Reputation: 0
calculate system clock in milliseconds


Hi

I am writing timer library which needs to return System clock time in milliseconds(in user space). I am not sure if i should use time(0) function, since it only give system clock accuracy interms of seconds. Or is it better to use gettimeofday and then calculate milliseconds from sec and microsecond data. Is there any other time system calls that i can use to get system clock in milliseconds
 
Old 06-14-2005, 11:25 AM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
Only gettimeofday() provides a millisecond resolution (and even then it may not be accurate to a single ms). For timing, you can use hardware-dependent clock cycle functions.
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
System clock correct, hardware clock wrong karlovac Linux - General 5 01-16-2009 07:19 PM
system clock alma Linux - Newbie 2 10-30-2005 02:06 PM
system clock,hardware clock varunbihani Linux - Newbie 2 07-23-2005 09:04 AM
system clock Gollum78 Linux - Hardware 0 05-04-2005 04:00 AM
system clock vs. CMOS clock dtamajka Linux - General 7 12-11-2003 05:56 PM


All times are GMT -5. The time now is 10:53 PM.

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