LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-29-2008, 05:52 AM   #1
jrksimha
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
do_gettimeofday() minimum resolution


Hi ,

I am trying to calculate delay between the two network interfaces

I tried using do_gettimeofday()function

But i am seeing that the resolution what i am getting is around minimumof 10ms

I am trying to calculate this on a MIPS platform

I tried testing it in following way

i am adding portion of code

struct timeval tv1,tv2
do_gettimeofday(&tv1);
udelay(100);
do_gettimeofday(&tv2);

When i tried tv2.tv_sec -tv1.tv_sec as well as tv2.tv_usec -tv1.tv_usec

the value returned is Zero.

The behaviour is the same when applied mdelay(3) instead of udelay in the above snippet.

What is the minimum resolution that i can get ?

if it is less than 10ms how can i get low resolution values

Regards
krishna

Last edited by jrksimha; 08-29-2008 at 05:54 AM.
 
Old 08-31-2008, 04:31 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
gettimeofday() will not easily give you such resolution, try clock_gettime() instead.
 
  


Reply



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
Minimum packages g4j31a5 Linux - Software 1 12-12-2006 01:53 AM
The RAM minimum ikovac Linux - Hardware 7 01-09-2005 08:44 PM
Minimum Install synapse Slackware 8 11-12-2004 01:28 PM
Need really minimum install GastoNet Slackware 2 05-03-2004 01:04 PM
minimum system for RH 7.1 JO770 Linux - Hardware 2 02-18-2003 10:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration