Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 31-01-2009, 05:53 PM   #1 (permalink)
Human Spambot
 
Join Date: Jan 2007
Location: Lat 28.38°N , Longt 77.13°E
Posts: 2,431
Default Finding function run time in C/C++


How can I find the time taken by a function during function executiong? time_t and clock function give time in mili second range, but I want time in micro/nano second range as using these time comes out to be 0. The only solution I could find was making a loop run a large number of time and dividing total time by that number, which I want to avoid. Can anyone help?
ThinkFree is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 31-01-2009, 06:41 PM   #2 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: Finding function run time in C/C++

Read:

http://www.devx.com/cplus/Article/35375/1954

if you are using visual c++,

http://www.codeproject.com/KB/system/timers_intro.aspx
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Old 01-02-2009, 02:34 PM   #3 (permalink)
Human Spambot
 
Join Date: Jan 2007
Location: Lat 28.38°N , Longt 77.13°E
Posts: 2,431
Default Re: Finding function run time in C/C++

Thanks for the reply
sys/time.h solved the problem.
ThinkFree is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help me finding mob. hskpunjabi Mobiles and Tablets 3 20-06-2008 11:00 PM
Finding Yourself without GPS iMav Technology News 29 10-12-2007 11:54 AM
PLz help me in finding a gud amd motherboard rohus24 Hardware Q&A 6 25-10-2006 08:16 PM
Finding J2SE 5.0 SDK ashu888ashu888 Software Q&A 13 05-08-2006 10:31 AM
finding all systeminfo using .net QnA (read only) 6 17-03-2005 02:25 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:06 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2