C 语言程序计时

来源:姥姥的数据结构课程web 咱们测试一个函数的运行时间时,就须要用到下面这套模板。数据结构 基本程序 #include<stdio.h> #include<time.h> clock_t start, stop; double duration;//记录被测函数运行时间,以s为单位 int main() { start = clock(); //开始计时,返回从程序开始的时钟
相关文章
相关标签/搜索