Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3270928
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:40:58+00:00 2026-05-17T18:40:58+00:00

I am currently stumbled into this problem and I’d love to hear some suggestions

  • 0

I am currently stumbled into this problem and I’d love to hear some suggestions from you.

I have a C++ program that uses a precompiled library to make some queries to PostgreSQL database. Now the problem is I want to find out the total (combined) cpu time it takes to do all routines described in the source code of the program and also the time it spends waiting for the database-related activities.

I used the time command in Linux, but it seems that it didn’t measure the time the program spent on the database.

And in my situation, it won’t be possible for me to recompile the library provided to me, so I don’t think things like gprof would work.

Any suggestions?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:40:58+00:00Added an answer on May 17, 2026 at 6:40 pm

    Of course you’ll get the wall-clock time anyway, but presumably you’re trying to get the CPU time.

    This is nontrivial when you have subprocesses (or unrelated processes) involved. However, you may want to try to have a more holistic approach to benchmarking.

    Measuring the latency of an application is easy enough (just watch the wall-clock) but throughput is generally harder.

    To get an idea of how an application behaves under load, you need to put it under load (on production-grade hardware), in a reproducible way.

    This normally means hitting it with lots of tasks concurrently, as modern hardware tends to be able to do several things at once. Moreover, if anything in your app ever waits for any external data source (including the hard drive of your own machine potentially), you can get better throughput even on a single core by having multiple requests being served at once.

    You may want to look at tools like oprofile, which is designed for profiling, not benchmarking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently learning Hibernate, and I've stumbled into this issue: I have defined 3
I am currently re-designing an application and stumbled upon a problem serializing some data.
Greets, I'm currently working on a website and have stumbled upon some layout difficulties.
I'm currently translating a application and i've stumbled upon a problem. I'm using this
I have an interesting problem that I need help with. I am currently working
I'm currently learning Ruby and RoR and I stumbled across this declaration: link_to_remote(name, options
Currently working with converting SQLException error messages into messages that are more useful for
I'm trying to extract the subdomain from the HTTP_HOST value. However I've stumbled into
I am currently experimenting with various input controls and have stumbled upon SneakyInput, which
Currently I'm working on a small program that reads large files and sorts them.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.