473,378 Members | 1,387 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,378 software developers and data experts.

ITIMER_VIRTUAL

Does anyone know how to make ITIMER_VIRTUAL display the elapsed time as
a possitive floating point number? when i:

printf("%ld")

i get a signed long int

and when i:

printf("%f")

i get 0.00000000

any help is appreciated

Nov 20 '06 #1
3 2269
andrew browning wrote:
Does anyone know how to make ITIMER_VIRTUAL display the elapsed time as
a possitive floating point number? when i:

printf("%ld")

i get a signed long int

and when i:

printf("%f")

i get 0.00000000

any help is appreciated
Hi,

I don't know how you define ITIMER_VIRTUAL (it is not in standard C++
anyway) but how about the following?

std::cout<<static_cast<float>(ITIMER_VIRTUAL)
Sincerely,

Peter Jansson
http://www.p-jansson.com/
http://www.jansson.net/
Nov 20 '06 #2
andrew browning wrote:
Does anyone know how to make ITIMER_VIRTUAL display the elapsed time as
a possitive floating point number? when i:

printf("%ld")

i get a signed long int

and when i:

printf("%f")

i get 0.00000000

any help is appreciated
What is type ITIMER_VIRTUAL? It is non-standard (which could indicate
you should be asking this in a platform-specific newsgroup; cf.
http://www.parashift.com/c++-faq-lit....html#faq-5.9). If you
use iostreams instead of printf (see
http://www.parashift.com/c++-faq-lit...html#faq-15.1), you
don't have to worry about what type it is.

Cheers! --M

Nov 20 '06 #3
VJ
andrew browning wrote:
Does anyone know how to make ITIMER_VIRTUAL display the elapsed time as
a possitive floating point number? when i:

printf("%ld")

i get a signed long int

and when i:

printf("%f")

i get 0.00000000

any help is appreciated
Try this if you using linux (otherwise search the web) :
man setitimer

it explains about ITIMER_VIRTUAL
Nov 21 '06 #4

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

Similar topics

1
by: martinm69x | last post by:
Hey all, I've been working on the code for a kernel timer which will report real time, CPU time, user time and kernel time on the operation of fibonacci method. The way im doing it is keeping...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.