1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LTIME/DIFFTIME.C Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,54 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* FUNCTION
1.19 +* <<difftime>>---subtract two times
1.20 +* INDEX
1.21 +* difftime
1.22 +* ANSI_SYNOPSIS
1.23 +* #include <time.h>
1.24 +* double difftime(time_t <[tim1]>, time_t <[tim2]>);
1.25 +* TRAD_SYNOPSIS
1.26 +* #include <time.h>
1.27 +* double difftime(<[tim1]>, <[tim2]>)
1.28 +* time_t <[tim1]>;
1.29 +* time_t <[tim2]>;
1.30 +* Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'
1.31 +* that are in seconds.
1.32 +* RETURNS
1.33 +* The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
1.34 +* PORTABILITY
1.35 +* ANSI C requires <<difftime>>, and defines its result to be in seconds
1.36 +* in all implementations.
1.37 +* <<difftime>> requires no supporting OS subroutines.
1.38 +*
1.39 +*
1.40 +*/
1.41 +
1.42 +
1.43 +
1.44 +#include <time.h>
1.45 +
1.46 +/**
1.47 +Return difference between two times.
1.48 +Calculates the time difference between tim1 and tim2 in seconds.
1.49 +@return The difference in seconds between the two times specified.
1.50 +@param tim2 Latter time
1.51 +@param tim1 Former time
1.52 +*/
1.53 +EXPORT_C double
1.54 +difftime (time_t tim1, time_t tim2) __SOFTFP
1.55 +{
1.56 + return ((double) (tim1 - tim2));
1.57 +}