Guest User

Untitled

a guest
Oct 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <thread>
  3.  
  4. void CStypleFunction() {
  5. printf("CStypleFunction() s\n");
  6. std::chrono::milliseconds dura(2000);
  7. std::this_thread::sleep_for(dura); // 2000 ミリ秒
  8. printf("CStypleFunction() e\n");
  9. }
  10.  
  11. void CppStypeClass::MainThread(int param) {
  12. printf("MainThread() start\n");
  13. bool bLoop = true; // thread control flag
  14. while (bLoop) {
  15. param--;
  16. if (param == 0) {
  17. bLoop = false;
  18. }
  19. }
  20. printf("MainThread() end\n");
  21. }
Add Comment
Please, Sign In to add comment