time.c

来自「一个Windows下的Linux专用虚拟机」· C语言 代码 · 共 44 行

C
44
字号
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. * */#include "linux_inc.h"#include <colinux/os/kernel/time.h>#include <colinux/common/common.h>#include <colinux/os/timer.h>unsigned long co_os_get_time(void){	return get_seconds();}void co_os_get_timestamp(co_timestamp_t *dts){	struct timeval tv;	do_gettimeofday(&tv);	dts->quad = tv.tv_sec;	dts->quad *= 1000000;        dts->quad += tv.tv_usec;}void co_os_get_timestamp_freq(co_timestamp_t *dts, co_timestamp_t *freq){	co_os_get_timestamp(dts);	if (freq)		freq->quad = 1000000;}unsigned long co_os_get_cpu_khz(void){	return cpu_khz;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?