developer tool -- time profiler
今天被大神教会了一招,不敢怠慢,先记下来,好好利用
如题,用到了 xcode developer tool里面的instruments里面的time profiler
该工具可以直接跑mac上面生成的可执行文件,并且能分析出整个程序中各个线程和函数的运行时间。直接上图
打开过程:

instruments
它应该是长这样的

我们选择time profiler,它应该是长这样的

接下来就厉害了
选择target


在这里可以输入 整个可执行文件要的参数
以及相关的workspace 然后点一下左上角的小红点,就可以跑程序了
我跑的程序是这个样子的

最后的结果

总的时间,每一个线程的时间,每一个函数的时间,cpu的情况,一览无余
苹果大法好呀。
后面有机会会更新其他的tools的用法!哦,又快9点了,我才不是996的程序猿,下班!
网友评论