Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <opencv2/imgcodecs/imgcodecs.hpp>
  2. #include <opencv2/highgui/highgui.hpp>
  3.  
  4. #include <mach/mach.h>
  5. #include <iostream>
  6. #include <ctime>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12. cout << cv::getBuildInformation() << endl;
  13.  
  14. cv::Mat image(1, 1, CV_8U);
  15.  
  16. time_t start;
  17. time_t cur;
  18. time(&start);
  19.  
  20. while (true)
  21. {
  22. cv::imshow("Pixel", image);
  23. cv::waitKey(1);
  24.  
  25. time_t tmp;
  26. time(&tmp);
  27. if (tmp != cur)
  28. {
  29. cur = tmp;
  30.  
  31. struct task_basic_info t_info;
  32. mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
  33. task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
  34.  
  35. cout << "Time: " << cur - start << " s, "
  36. << "Resident: " << t_info.resident_size / (1024 * 1024) << " Mib"
  37. << endl;
  38. }
  39. }
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement