Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: check elapsed time
  • Loading branch information
juni5184 committed Jul 11, 2025
commit a6e08344ac0dc5acb0a05d3252068efd534ad22e
8 changes: 6 additions & 2 deletions example/go2/go2_video_client_custom.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <ctime>
#include <cmath>
#include <chrono>

#include <opencv2/opencv.hpp> // OpenCV for image processing

Expand Down Expand Up @@ -40,6 +39,7 @@ int main()

while (true)
{
auto start_time = std::chrono::steady_clock::now(); // frame start time
ret = video_client.GetImageSample(image_sample);

if (ret == 0 && !image_sample.empty()) {
Expand Down Expand Up @@ -89,6 +89,10 @@ int main()
} else {
std::cout << "Waiting for valid pose data..." << std::endl;
}

auto end_time = std::chrono::steady_clock::now();
auto elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
std::cout << "Elapsed time: " << elapsed_time << " ms" << std::endl;
}

usleep(50000); // 0.05 seconds
Expand Down