Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Request speed in QNAM

[Solved] Request speed in QNAM

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 878 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.
  • A Offline
    A Offline
    ashishbansal
    wrote on last edited by
    #1

    Hi everyone,
    I want to know the speed of the HTTP get request made to some link using QNetworkAccessManager.
    I have checked QNetworkReply api and was not able to find such function.
    But what I found is this [1] but there is not mention anywhere after how much time, this signal will be emitted. So that I would be able to know the download speed.
    Does anybody knows this time?
    Or any other better solution to get download speed.
    [1] http://doc.qt.io/qt-5/qnetworkreply.html#downloadProgress

    Thanks,
    Ashish Bansal

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      pownloadProgress is not emitted at constant intervals.
      Use "QElapsedTimer":http://doc.qt.io/qt-5/qelapsedtimer.html. Start it when you make the request and use "restart":http://doc.qt.io/qt-5/qelapsedtimer.html#restart in the downloadProgress handler to obtain amount of time passed between these signals. Speed is then the amount of data (obtained from bytesReceived parameter of the downloadProgress) divided by the time from the timer. Make sure to get the units right.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ashishbansal
        wrote on last edited by
        #3

        [quote author="Chris Kawa" date="1419793610"]pownloadProgress is not emitted at constant intervals.
        Use "QElapsedTimer":http://doc.qt.io/qt-5/qelapsedtimer.html. Start it when you make the request and use "restart":http://doc.qt.io/qt-5/qelapsedtimer.html#restart in the downloadProgress handler to obtain amount of time passed between these signals. Speed is then the amount of data (obtained from bytesReceived parameter of the downloadProgress) divided by the time from the timer. Make sure to get the units right.[/quote]

        Thanks Chris!!

        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 Extensions
        • Unsolved