0

Before everything sorry for my english, i am italian, and italians are not so good with other langs... Anyway, here's my actual code:

     time_t t = time(0);
     struct tm * now = localtime( & t );
     cout << (now->tm_mday) << '/' 
     << (now->tm_mon + 01) << '/'
     << (now->tm_year + 1900) << endl;
     cout << (now->tm_hour) << ':'
     << (now->tm_min) << ':'
     << (now->tm_sec) << endl;
     cout << ;
     system("cls");`

Well, as you can see it prints out date(italian date order, so GG-MM-YYYY) and hour:mins:secs. Is there something like now->tm_millisecond? Or it's more complicated? As you can imagine i don't want the current date in millinseconds(millisecons passed till years 0) as almost everyone wants. I just want to get the elapsed time in MSs from the last beginning of a second. I am a beginner in c++, the basic code's took around the web. I just wan't the satisfaction to get itfinished. PLEASE DO NOT TELL ME TO MAKE BETTER THIS, TO MAKE BETTER THAT, TO USE A NEW WAY TO CLEAR SCREEN INSTEAD OF system("cls") RESPOND TO WHAT I ASKED.

  • [gettimeofday](http://man7.org/linux/man-pages/man2/gettimeofday.2.html), which can get microsecond information, may be useful. – MikeCAT Feb 28 '16 at 14:12
  • You should also look at [`std::difftime`](http://en.cppreference.com/w/cpp/chrono/c/difftime) – Cory Kramer Feb 28 '16 at 14:13

0 Answers0