//方法执行前获取系统时间 long long start = clock(); //执行func方法 func(); //方法执行后获取系统时间 long long end = clock(); //所以,func函数的执行时间,单位为ms int timeVal = (end - start) * 1000 / CLOCKS_PER_SEC;

//方法执行前获取系统时间 long long start = clock(); //执行func方法 func(); //方法执行后获取系统时间 long long end = clock(); //所以,func函数的执行时间,单位为ms int timeVal = (end - start) * 1000 / CLOCKS_PER_SEC;