times函数还有使两数相乘的作用吗?
如:
if(over([times(middle,middle),target]))
right=middle;
else
left=middle;
IDE中,在不明白的符号times上点鼠标右键,选转到定义。
获取进程时间。
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/times.h>
clock_t time_head , time_end ;
int main ()
{
time_head = times ( & time_buf_head ); /*进程运行到此时的系统时钟数(总的)*/
printf ("head_time is : %f /n " , time_head / (double )tck ); /*此时进程所处的时间点(单位为秒)*/
}