Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Way to measure a programs idle time.

    General and Desktop
    2
    2
    551
    Loading More Posts
    • 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
      darkp03 last edited by

      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 Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • First post
          Last post