Namensräume
Varianten
Aktionen

std::difftime

Aus cppreference.com
< cpp‎ | chrono‎ | c

 
 
 
 
C-style Datum und Uhrzeit Versorgungsunternehmen
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Zeit Manipulation
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
Format Konvertierungen
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
Konstanten
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <ctime>
double difftime( time_t time2, time_t time1 );
Berechnet Differenz zwischen zwei Kalenderjahren mal so time_t Objekte (time2 - time1) in Sekunden .
Original:
Computes difference between two calendar times as time_t objects (time2 - time1) in seconds.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Parameter

time1, time2 -
mal zu vergleichen
Original:
times to compare
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

Differenz zwischen zwei Zeiten in Sekunden
Original:
Difference between two times in seconds
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

#include <iostream>
#include <ctime>
int main()
{
    std::time_t start = std::time(NULL);
    volatile double d;
    for(int n=0; n<10000; ++n)
       for(int m=0; m<100000; ++m)
           d += d*n*m; // some time-consuming operation
    std::cout << "Wall time passed: "
              << std::difftime(std::time(NULL), start) << " s.\n";
}

Output:

Wall time passed: 7 s.

[Bearbeiten] Siehe auch

(C++11)
ein Zeitintervall
Original:
a time interval
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Klassen-Template) [edit]
C documentation for difftime