c++ 计时

来源:互联网 发布:天池大数据竞赛 新手 编辑:程序博客网 时间:2024/06/14 15:04

   #include <sys/time.h>

    struct timeval start,end;

    gettimeofday(&start,NULL);
    if (!load_pattern_pred_mapping_dict(pred_norm_dict_file)) {
        fprintf(stderr, "load pattern pred mapping dict file failed, pls check file: %s\n", pred_norm_dict_file);
        return false;
    }

    gettimeofday(&end,NULL);

    printf("load pred norm dict used:%d s\n",(int)(end.tv_sec - start.tv_sec));

0 0
原创粉丝点击