Advertisement
Guest User

321

a guest
Feb 26th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <chrono>
  4. #include <ctime>
  5. #include <unistd.h>
  6. #include <ncurses.h>
  7. #include <errno.h>
  8. #include <sys/wait.h>
  9.  
  10. int main()
  11. {
  12. FILE* out = fopen("out.txt", "w");
  13. FILE* in = fopen("in.txt", "w");
  14. auto child_time = std::chrono::system_clock::now();
  15. auto time_t_child = std::chrono::system_clock::to_time_t(child_time);
  16. newterm(getenv("TERM"), out, in);
  17. std::cout << std::ctime(&time_t_child) << std::endl;
  18. printw("Time: %s, pid: %d\n", std::ctime(&time_t_child), getpid());
  19. refresh();
  20. endwin();
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement