0

How to use NSTimer to check the performance of function? Actually, I am making a dylib which is Cydia Software. I have found many resources, but I still don't know which part of my functions slow down whole program. I need someone's help....

KKTong
  • 1

2 Answers2

0

Why don't you try and use Instruments with time profiler? This will give you plenty of information without the hassle of having to come up with a timer based handcrafted profiler.

Have a look at this article for more details.

sergio
  • 68,819
  • 11
  • 102
  • 123
0

The clock function returns a tick of type clock_t that is defined by a CLOCKS_PER_SEC constants. Posix requires this value to be 1000000 ticks per second (microsecond), but that is not guaranteed by ANSI-C. So, you should check CLOCKS_PER_SEC to see the actually resolution on your platform.

duplicated question: How to measure time in milliseconds using ANSI C?

Community
  • 1
  • 1
xhan
  • 6,057
  • 4
  • 33
  • 47
  • actually, I am using dylib that cannot be checked by this directly. I think I need a timing code like NSTimer. I found a source code from your reference. – KKTong Jul 05 '11 at 08:13