Results 1 to 3 of 3

Thread: [QTime] Create Thread time Mesure

  1. #1

    Default [QTime] Create Thread time Mesure

    Hi,

    I would like mesure with QTime the time between the creation and using thread

    In fact, I don't know how retrieve Qtime object in thread? Should it be passed as a thread parameter ?

    Or else there is another way without using QTime?

    Thank you

    regards
    Loïc

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: [QTime] Create Thread time Mesure

    What does "using thread" mean?

    When it starts executing its run() method?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: [QTime] Create Thread time Mesure

    Do you really care how long it takes to start a thread? I would suggest that if your design is such that you are creating/terminating threads often enough that you are concerned with the overhead of doing so, then you should re-think your design... For example, start your thread and then feed it work via emitting a signal, or serializing a data structure like a QVector/QList/QMap, etc. that contains elements from the thread to work on.

    Alternatives: use a thread pool or Qt's map/reduce type functionality.

    Can you explain why this timing is critical for your needs?
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

Similar Threads

  1. Create QMainWindow from different thread
    By Viatorus in forum Qt Programming
    Replies: 8
    Last Post: 21st February 2015, 02:28
  2. Update time on screen using a thread.
    By TFH in forum Qt Programming
    Replies: 6
    Last Post: 14th November 2011, 15:41
  3. Replies: 2
    Last Post: 8th February 2011, 15:53
  4. GUI Thread getting no time to process
    By steg90 in forum Qt Programming
    Replies: 11
    Last Post: 9th May 2007, 10:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.