Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Way to measure a programs idle time.
Qt 6.12 LTS is out! See what's new in the release blog

Way to measure a programs idle time.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    darkp03
    wrote on last edited by
    #1

    Hi everyone.

    Im working on a program thats supposed to listen a UdpSocket, TcpSocket, an USB connection and insert a high amount of data on SQL. The thing is, that Id like to know my program performance, and if im able to add more code or I would be risking not having enough time to process the incoming data.

    My question... Is there a way to measure how much time my program is idle? I mean, how much time it spends on any of the threads it has, and how much time is simply waiting for an interruption.
    Ive read that with QElapsedTimer I can know with detail the amount a time a method or an operation takes, but what I would like to know is the exact opposite, how much time is doing nothing.

    Im running on Windows, so I cant use the QML Profiler, (or at least thats what Ive understood from the documentation... Can QML profiler be used on Windows?)

    Thanks in advance!

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I don't think idle time is useful. What is really important is the question whether your application is able to handle everything under high load. I mean, even if most of the time your application is idle it can still be too slow if later you get input from your sockets, USB connection and write something to the database.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved