[Qt-interest] how to computing costed time of a function?
James Yan
jyan972 at gmail.com
Tue Jul 21 18:46:23 CEST 2009
thanks all, so i guess i have to using other method/tool on Qt/windows,
maybe visual C++ IDE profiler will be a solution.
On Thu, Jul 16, 2009 at 5:40 PM, Thiago Macieira <
thiago.macieira at trolltech.com> wrote:
> Em Quinta-feira 16 Julho 2009, às 11:28:54, Amit Pundir escreveu:
> > On Thu, Jul 16, 2009 at 2:26 PM, Christopher Rasch-Olsen
> >
> > Raa<christopher at technophile.info> wrote:
> > > You could use QTime for such measurement. Have a look at
> QTime::start().
> > > QTime timer;
> > > timer.start();
> > > long_operation();
> > > qDebug() << "Elapsed:" << timer.elapsed();
> >
> > Hi, is there any way to measure elapsed time in microseconds?
>
> You need a high-resolution timer for that. You're going to need operating
> system help for that, in order to access some performance registers
> available
> in most modern CPUs.
>
> So Qt doesn't offer any such thing. I recommend using valgrind (tool
> callgrind)
> and oprofile on Linux.
>
> --
> Thiago Macieira - thiago.macieira (AT) nokia.com
> Senior Product Manager - Nokia, Qt Software
> Sandakerveien 116, NO-0402 Oslo, Norway
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090722/0d8e7b5c/attachment.html
More information about the Qt-interest-old
mailing list