美文网首页
时间代码块的调试

时间代码块的调试

作者: bluesea哈哈哈 | 来源:发表于2016-07-30 15:22 被阅读20次

    #import// for mach_absolute_time

    double MachTimeToSecs(uint64_t time)

    {

    mach_timebase_info_data_t timebase;

    mach_timebase_info(&timebase);

    return (double)time * (double)timebase.numer /  (double)timebase.denom / 1e9;

    }

    uint64_t begin = mach_absolute_time();

    [self doSomething];

    uint64_t end = mach_absolute_time();

    NSLog(@"Time %g s", MachTimeToSecs(end - begin));

    相关文章

      网友评论

          本文标题:时间代码块的调试

          本文链接:https://www.haomeiwen.com/subject/vektsttx.html