difftime.c

来自「vxworks源码源码解读是学习vxworks的最佳途径」· C语言 代码 · 共 47 行

C
47
字号
/* difftime.c - difftime file for time *//* Copyright 1992-1993 Wind River Systems, Inc. *//*modification history--------------------01c,05feb93,jdi  documentation cleanup for 5.1.01b,20sep92,smb  documentation additions01a,25jul92,smb  written.*//*  DESCRIPTION    INCLUDE FILE: time.h   SEE ALSO: American National Standard X3.159-1989 NOMANUAL*/#include "vxWorks.h"#include "time.h"/********************************************************************************* difftime - compute the difference between two calendar times (ANSI)** This routine computes the  difference between two calendar times: * <time1> - <time0>.** INCLUDE FILES: time.h** RETURNS: The time difference in seconds, expressed as a double.*/  double difftime    (    time_t time1,		/* later time, in seconds */    time_t time0		/* earlier time, in seconds */    )    {    return (time0 <= time1 ? (double) (time1 - time0) 			   : -(double) (time1 - time0));    }

⌨️ 快捷键说明

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