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. Qt C++ microSecond And Nanosecond time calculate
Qt 6.11 is out! See what's new in the release blog

Qt C++ microSecond And Nanosecond time calculate

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.6k Views 2 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
    alonewolfsemmmy
    wrote on last edited by
    #1

    Hello Guys I need Qt C++ serial port read microsecond an nanoSecond calculate and time stamp Please Can you help me

    jsulmJ 1 Reply Last reply
    0
    • A alonewolfsemmmy

      Hello Guys I need Qt C++ serial port read microsecond an nanoSecond calculate and time stamp Please Can you help me

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @alonewolfsemmmy Sorry, can you please explain better? I don't understand what you want. Do you want to read time stamps over serial bus, or what?

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

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

        Yes I definetely My Friend When serial port read and microsecond timestamp read

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alonewolfsemmmy
          wrote on last edited by
          #4

          Yes I definetely @jsulm

          jsulmJ 1 Reply Last reply
          0
          • A alonewolfsemmmy

            Yes I definetely @jsulm

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @alonewolfsemmmy What exactly do you want to calculate with these timestamps? What is the problem? You know how many microseconds is a second, right? So, should be easy to calculate.

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

            1 Reply Last reply
            1
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              Also you can use std::chrono::duration to convert between units of duration.

              1 Reply Last reply
              1
              • Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by
                #7

                You of course know that in most desktop OS the userland time granularity is limited to the millisecond magnitude? If you want to truly track and make use of microsecond time events you must do it in the kernel and/or use an RTOS (which then isn't relevant to Qt).

                Here is an example. You send uart data at some microsecond periodic rate and expect it to be read and timestamped on the receiver with the same normalized periodic frequency that it was sent. Well, it won't be because if it is a userland program that is timestamping the data when it arrives then there is no guarantee that the reading process wakes up exactly when the data becomes available.

                The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

                1 Reply Last reply
                1

                • Login

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