- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- change CLK_TCK to get ms granularity ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 11:03 PM
тАО07-08-2003 11:03 PM
change CLK_TCK to get ms granularity ?
I started using times() function to get the CPU usage in programs and it's very helpful! but unfortunately the resolution of measure is 1/100 sec which does not help much for small pieces of code that I would like to optimize.
Is there a safe way to change CLK_TCK to a better value (1000 or 10000) without breaking everything?
Thanks
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 11:26 PM
тАО07-08-2003 11:26 PM
Re: change CLK_TCK to get ms granularity ?
looking at the man page:
"The times are in units of 1/CLK_TCK seconds,
where CLK_TCK is processor dependent The value of CLK_TCK can be
queried using the sysconf() function"
If CLK_TCK is cpu dependent, i don't think you can have luck...
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 03:13 AM
тАО07-09-2003 03:13 AM
Re: change CLK_TCK to get ms granularity ?
If you take a look at time.h header file, you will see:
#ifndef
#define CLOCKS_PER_SEC 1000000
I guess you can override the value with your own.
Worth a try.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 03:55 AM
тАО07-09-2003 03:55 AM
Re: change CLK_TCK to get ms granularity ?
Then if I can try, What do you suggest to do it?
I don't know where I should modify :
-should I change the include file? (risky!)
-should I move it to a my_include directory and compile with my_include?
What are your suggestion?
(I know I abuse of your time!)
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 04:06 AM
тАО07-09-2003 04:06 AM
Re: change CLK_TCK to get ms granularity ?
i wuold build a my_include, because that function could be used in many other programs, and i would not risk to compromise the stability of your system at the next kernel rebuild, in case you forget to put the original value back.
For example, i remember that the "top" program uses this value....
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 10:29 PM
тАО07-09-2003 10:29 PM
Re: change CLK_TCK to get ms granularity ?
As Massimo mentioned above, it is much wiser to create your header files and include it because there might be other applications using this parameter too.
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 03:20 PM
тАО07-11-2003 03:20 PM
Re: change CLK_TCK to get ms granularity ?
You can also get good information about which functions are taking the most time using the prospect profiler available from http://www.hp.com/go/prospect .