fork(1) download
  1. #include <iostream>
  2. #include <chrono>
  3. using namespace std;
  4.  
  5. int main() {
  6. using clock = std::chrono::system_clock;
  7. clock::time_point nowp = clock::now();
  8. clock::time_point end = nowp + std::chrono::seconds(10);
  9. time_t nowt = clock::to_time_t ( nowp );
  10. time_t endt = clock::to_time_t ( end);
  11. std::cout << " " << ctime(&nowt) << "\n";
  12. std::cout << ctime(&endt) << std::endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 4500KB
stdin
Standard input is empty
stdout
 Sat Dec 16 15:21:28 2017

Sat Dec 16 15:21:38 2017