Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdiverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : difftime

doubledifftime(time_t time1,time_t time0) ;

Return Type : double

Double-precision floating point (±1.7E±308, ~15 decimal digits)
Read about return values of difftime function .

1st Parameter Type : time_t

Integer type for timestamps (seconds since epoch)

1st Parameter

The later time, represented as the number of seconds since the epoch

2nd Parameter Type : time_t

Integer type for timestamps (seconds since epoch)

2nd Parameter

The earlier time, represented as the number of seconds since the epoch

Read more about parameters of difftime in parameters section
The difftimefunction in C language Computes the difference in seconds between two times.
The difftime function computes the difference between two calendar times: time1 - time0. This function is useful for calculating elapsed time or durations between two points in time. The result is expressed in seconds and is a floating-point value to allow for fractional seconds.
The difftimefunction takes 2 parameters:
  • time_t `time1`: The later time, represented as the number of seconds since the epoch
  • time_t `time0`: The earlier time, represented as the number of seconds since the epoch
Computes the difference in seconds between two time values, `time1 - time0`, and returns the result as a `double`. Handles time calculations safely even if `time_t` is an integer type.
The difftime function return value :
  • Returns the number of seconds elapsed between time1 and time0, as a double

Output

This example demonstrates the basic usage of the `difftime` function. It measures the time taken by a loop that performs some arbitrary work.