Results 1 to 3 of 3

Thread: How to measure a time difference in miliseconds?

  1. #1
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default How to measure a time difference in miliseconds?

    Hi,

    I'ld like to measure a time difference (in miliseconds) between two operations. How to get a current time in milliseconds?
    for example
    Qt Code:
    1. int microStart = function_time_in_miliiseconds();
    2. operationr1();
    3. int microEnd = function_time_in_miliiseconds();
    4. ind difference = microEnd-mircoStart;
    To copy to clipboard, switch view to plain text mode 
    thanks

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to measure a time difference in miliseconds?

    Qt Code:
    1. QTime time;
    2. time.start();
    3. // operation
    4. int difference = time.elapsed();
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to aamer4yu for this useful post:

    TomASS (26th April 2010)

  4. #3
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to measure a time difference in miliseconds?

    Thank you, that's what i'm saying

Similar Threads

  1. Date and Time Difference
    By MIH1406 in forum Newbie
    Replies: 4
    Last Post: 20th August 2012, 16:03
  2. Difference between the regulare MVC
    By Jonas_ in forum Newbie
    Replies: 3
    Last Post: 2nd September 2009, 15:59
  3. Replies: 1
    Last Post: 7th October 2008, 13:11
  4. check the time of last time keyboard is pressed
    By Aki Tomar in forum General Programming
    Replies: 2
    Last Post: 5th February 2008, 10:10
  5. How to measure memory of Qt Application,
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2007, 18:03

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.