Pierre Angelo

Generation

generate functionWed, 05 Apr 2023

¿Cómo mostrar por pantalla el tiempo transcurrido en unity?

#include <iostream> #include <time.h> using namespace std; int main () { time_t timer; struct tm y2k = {0}; double seconds; y2k.tm_hour = 0; y2k.tm_min = 0; y2k.tm_sec = 0; y2k.tm_year = 100; y2k.tm_mon = 0; y2k.tm_mday = 1; time(&timer); /* get current time; same as: timer = time(NULL) */ seconds = difftime(timer,mktime(&y2k)); cout << seconds << " seconds since January 1, 2000 in the current timezone" << endl; return 0; }

Questions about programming?Chat with your personal AI assistant