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. How to compare timestamp in qt?
Qt 6.11 is out! See what's new in the release blog

How to compare timestamp in qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 827 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.
  • B Offline
    B Offline
    Beginner_to_code
    wrote on last edited by
    #1

    In Qt how to compare the timestamp in a loop if it reach 100ms every second it will break the loop.Anybody tells me how to do that

    jsulmJ 1 Reply Last reply
    0
    • B Beginner_to_code

      In Qt how to compare the timestamp in a loop if it reach 100ms every second it will break the loop.Anybody tells me how to do that

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

      @Beginner_to_code Please provide more information.
      What exactly is timestamp here (what is its data type)?
      Please show your current code and explain what happens.

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

      1 Reply Last reply
      1
      • B Offline
        B Offline
        Beginner_to_code
        wrote on last edited by
        #3

        I need to get system current time and check the time in a loop until it reach 100ms .
        if it reach 100ms it will print some debug statement and wait for the next second to reach 100ms.
        I am going to log those statements in a file which contains the timestamp like(
        15:08:36:100
        15:08:37:100
        15:08:38:100
        15:08:39:100
        15:08:40:100
        15:08:41:100
        15:08:42:100
        15:08:43:100
        15:08:44:100
        15:08:45:100
        15:08:46:100
        15:08:47:100)

        artwawA 1 Reply Last reply
        0
        • B Beginner_to_code

          I need to get system current time and check the time in a loop until it reach 100ms .
          if it reach 100ms it will print some debug statement and wait for the next second to reach 100ms.
          I am going to log those statements in a file which contains the timestamp like(
          15:08:36:100
          15:08:37:100
          15:08:38:100
          15:08:39:100
          15:08:40:100
          15:08:41:100
          15:08:42:100
          15:08:43:100
          15:08:44:100
          15:08:45:100
          15:08:46:100
          15:08:47:100)

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by artwaw
          #4

          @Beginner_to_code don't do it in the loop. Use QTimer with 100ms interval. https://doc.qt.io/qt-5/qtimer.html

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          2

          • Login

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