当前位置:网站首页>Time of process

Time of process

2022-07-05 05:34:00 Raise items

system time

CPU Running on the Kernel mode Time for

User time

CPU Running on the User mode Time for

Real time

Process from Start to end The total time of , Include I/O Time ,CPU Time , Process switching And so on .

example

myCp.c

#include <stdio.h>
#include <unistd.h>

int main()
{
    
	int size = 1;
	char buf[size];
	int n = 0;

	while ((n = read(STDIN_FILENO, buf, size)) > 0) {
    
		if (write(STDOUT_FILENO, buf, n) != n) {
    
			printf("write error\n");
			break;
		}
	}

	sleep(1);

	return 0;
}

Running results :

 Insert picture description here

原网站

版权声明
本文为[Raise items]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140621236562.html