Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PointMatcherSupport::timer seems off #585

Open
Louis-ThomasSchreiber opened this issue Aug 29, 2024 · 2 comments
Open

PointMatcherSupport::timer seems off #585

Louis-ThomasSchreiber opened this issue Aug 29, 2024 · 2 comments
Assignees

Comments

@Louis-ThomasSchreiber
Copy link

Louis-ThomasSchreiber commented Aug 29, 2024

I tried using the default PerformanceInspector and the FileLogger available in libpointmatcher. The output times looked off: The mean iteration time x number of iterations is 10x the actual execution time. I tried investigating with this simple test:

const Time::V time1 = Time::Clock::now();
PointMatcherSupport::timer t1;
t1.restart();

this_thread::sleep_for(chrono::seconds(10));

const Time::V time2 = Time::Clock::now();

std::cout << "PM:timer time = " << t1.elapsed() << " chrono duration = "
          << std::chrono::duration_cast<std::chrono::milliseconds>(time2 - time1).count() << std::endl;

which outputs:
PM:timer time = 4.9282e-05 chrono duration = 10000

I would expect:

PM:timer time = 10 chrono duration = 10000

Is there something I dont understand?

@boxanm boxanm self-assigned this Aug 30, 2024
@boxanm
Copy link
Collaborator

boxanm commented Aug 31, 2024

Hello @Louis-ThomasSchreiber !
I tested your example, and everything seems functional on my side, as I'm getting the correct results:

╰─$ ./examples/timer
PM:timer time = 10.0046 chrono duration = 10004 ms

Can you provide more information about your system? If you are on Ubuntu or MacOS, you run one of the following scripts: utest/listVersionsUbuntu.sh or utest/listVersionsMacOS.sh.

@Louis-ThomasSchreiber
Copy link
Author

Im running Unutu 20.04 in a docker container, my PC runs Ubuntu 22.04.

Name Version
ubuntu: Description: Ubuntu 20.04.6 LTS
architecture: 64-bit
gcc: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
git: git version 2.25.1
cmake: cmake version 3.16.3 CMake suite maintained and supported by Kitware (kitware.com/cmake).
boost: Version: 1.71.0.0ubuntu2
eigen3: Version: 3.3.7-2
dpkg-query: package 'doxygen' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
doxygen:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants