Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/imgcodecs/imgcodecs.hpp>
- #include <opencv2/highgui/highgui.hpp>
- #include <mach/mach.h>
- #include <iostream>
- #include <ctime>
- using namespace std;
- int main()
- {
- cout << cv::getBuildInformation() << endl;
- cv::Mat image(1, 1, CV_8U);
- time_t start;
- time_t cur;
- time(&start);
- while (true)
- {
- cv::imshow("Pixel", image);
- cv::waitKey(1);
- time_t tmp;
- time(&tmp);
- if (tmp != cur)
- {
- cur = tmp;
- struct task_basic_info t_info;
- mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
- task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
- cout << "Time: " << cur - start << " s, "
- << "Resident: " << t_info.resident_size / (1024 * 1024) << " Mib"
- << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement