473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to get RTC tick under user mode?

Hi 'body, is there any function to get the RTC ticks under user mode
on linux?
I could not use gettimeofday because it is too slow and affects
measures...
Nov 16 '07 #1
3 2892
In article <77**********************************@d61g2000hsa. googlegroups.com>,
frakie <fr*******@gmail.comwrote:
>Hi 'body, is there any function to get the RTC ticks under user mode
on linux?
I could not use gettimeofday because it is too slow and affects
measures...
There is no way to do that using only the facilities provided
by the C language itself. You will need to use system-specific
extensions. Please consult a linux programming newsgroup (and it might
be in a linux programming FAQ somewhere.)
--
"I will speculate that [...] applications [...] could actually see a
performance boost for most users by going dual-core [...] because it
is running the adware and spyware that [...] are otherwise slowing
down the single CPU that user has today" -- Herb Sutter
Nov 16 '07 #2
"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.caa écrit dans le message de
news: fh**********@canopus.cc.umanitoba.ca...
In article
<77**********************************@d61g2000hsa. googlegroups.com>,
frakie <fr*******@gmail.comwrote:
>>Hi 'body, is there any function to get the RTC ticks under user mode
on linux?
I could not use gettimeofday because it is too slow and affects
measures...

There is no way to do that using only the facilities provided
by the C language itself. You will need to use system-specific
extensions. Please consult a linux programming newsgroup (and it might
be in a linux programming FAQ somewhere.)
Google for: RDTSC linux

--
Chqrlie.
Nov 18 '07 #3
On 18 Nov, 22:43, "Charlie Gordon" <n...@chqrlie.orgwrote:
"Walter Roberson" <rober...@ibd.nrc-cnrc.gc.caa écrit dans le message denews: fhkkd6$mn__BEGIN_MASK_n#9g02mG7!__...__*********** ***********@canopus.cc.umanitoba.ca...
In article
<7722c4e9-6411-44e7-a038-46f47377b...@d61g2000hsa.googlegroups.com>,
frakie <frakie...@gmail.comwrote:
>Hi 'body, is there any function to get the RTC ticks under user mode
on linux?
I could not use gettimeofday because it is too slow and affects
measures...
There is no way to do that using only the facilities provided
by the C language itself. You will need to use system-specific
extensions. Please consult a linux programming newsgroup (and it might
be in a linux programming FAQ somewhere.)

Google for: RDTSC linux

--
Chqrlie.
Thanks this is really useful!
extern __inline__ unsigned long long int rdtsc()
{
long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}

By now I have to find a divisor to transform it in microseconds.. :)
Nov 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark S | last post by:
I have a db maintenance plan which is set to backup (then truncate hopefully) the transaction log. In order to backup a transaction log the db must be in single user mode so the maint. plan fails. ...
5
by: Matthew Louden | last post by:
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'" error message. I then did the following, but...
10
by: Martin Eyles | last post by:
Hi, I want to make a scale on a graph, by telling asp to insert empty divs of class tick, and the setting the style in css. I am trying to get a 3D effect by using colored top and bottom borders...
4
by: Dan | last post by:
Hi, I have a timer on a form (System.Windows.Forms.Timer - Framework 1.1) that is set to 60 seconds as sort an of inactivity monitor. If 60 seconds have elapsed without any user activity I want...
7
by: Jayyde | last post by:
Is there any way to accomplish this? The forms _Load event fires off several other small ones that I'd like to track time for. I can't get either the Mdi Parent form's timer _Tick event or the...
5
by: Gem | last post by:
Hi There, I'm new to the fourm although I have used it lots of times looking for answers in the past and it's been great. Can someone give me a nudge in the right direction with this niggley naggley...
1
by: Inaccessable | last post by:
This is probably very simple but still beyond me. I have a table that stores text in a number of different languages. Each entry has a unique ID number. Each language version of the same text...
4
by: paul.bentley | last post by:
I am trying to get a "Date entered" box to automatically fill when a tick box = true, without success so its over to the experts for some much needed help Thanks in advance
18
by: sweeneye | last post by:
Hi, I'm basing a query on the variables used in a form. The database contains lots of problems, say with a computer and a tick box for the apropriate component like monitor, keyboard, mouse etc....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.