473,804 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2917
In article <77************ *************** *******@d61g200 0hsa.googlegrou ps.com>,
frakie <fr*******@gmai l.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.n rc-cnrc.gc.caa écrit dans le message de
news: fh**********@ca nopus.cc.umanit oba.ca...
In article
<77************ *************** *******@d61g200 0hsa.googlegrou ps.com>,
frakie <fr*******@gmai l.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.o rgwrote:
"Walter Roberson" <rober...@ibd.n rc-cnrc.gc.caa écrit dans le message denews: fhkkd6$mn__BEGI N_MASK_n#9g02mG 7!__...__****** *************** *@canopus.cc.um anitoba.ca...
In article
<7722c4e9-6411-44e7-a038-46f47377b...@d6 1g2000hsa.googl egroups.com>,
frakie <frakie...@gmai l.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
19490
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. How do you automatically set the db, in single user mode, for the transaction log to be backed up then truncated? Also, I manually set the db in single user mode and it shows itself to be in single user mode yet the number of users in the db...
5
2391
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 still didn't work. Any ideas?? 1. In IIS console, right click the virtual directory 2. click directory security tab 3. click edit button on anonymous access 4. click browse button
10
2206
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 on the divs, and setting their height to 0. The code bellow show an example tick, and it all looks beautiful in firefox, but in internet explorer, the height appears to be ignored. Does anyone have any ideas? Thanks, Martin
4
3342
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 the form to close. I stop/start the timer at button clicks and keydown events etc of the various controls on the form. Users have reported the form closing in the middle of them typing or immediately after opening the form (but only rarely)....
7
8225
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 child form that I'm opening's _Tick to actually fire off. Any help any of you gurus can give me will be much appreciated :). -Jayyde
5
2203
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 problem? I have 3 chkboxes on the bottom of a form. It is essential that the user does not miss checking at least one box before clicking a button to move to the next form. So I included this code to the button to force a msgbox to pop up (before...
1
2130
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 shares the ID number. I have a column of tick boxes that show where this text is used. ie 1.0 English_text_record_1 tickcol1=y tickcol2=n tickcol3=y 1.0 French_text_record_1 tickcol1=y tickcol2=n tickcol3=y 1.0 Spanish_text_record_1...
4
3205
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
3115
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. and each has several eg problem 1 has a monitor and mouse problem My form then has what to look for tick boxes (tri-state) for each of these. I want my query to include all monitor problems when that is ticked and all monitor and mouse problems...
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.