This whole directory is a subtree of https://github.com/mp3guy/Stopwatch . As such, it is created by Thomas Whelan et al. (https://github.com/mp3guy) without any changes by us. The code is re-distributed here to be able to use it within the larger package structure.

Since some of the code is attributed to the b-human code release, we include the following license, which applies to those parts:

LICENSE

Copyright (c) 2016 B-Human. All rights reserved.

Preamble: B-Human releases most of the software it uses at RoboCup competitions to allow teams participating in the Standard Platform League that do not have the resources to develop a complete robot soccer system on their own, but still have important contributions to make to the goals of RoboCup. We intend to enable such teams to benchmark their own scientific approaches in RoboCup competitions. We also hope that the scientific community will benefit from their work through the publication of their findings. A second reason for B-Human releasing its code is that source code is the most solid documentation of how problems were actually solved.

Parts of this distribution were not developed by B-Human. This license doesn’t apply to these parts, the rights of the copyright owners remain.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  1. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  2. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: “This product includes software developed by B-Human (http://www.b-human.de).” Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear.
  3. If the source code or parts of the source code shall be used for a RoboCup competition, the competing program must differ in at least multiple major parts from the original distribution. “Major parts” means own contributions to the RoboCup goal, which are potentially publishable and usually manifest themselves as new modules (i.e. source code) and not just as a parameterization of existing technology (e.g. walking parameters, kicks, behavior options).
  4. For each B-Human code release from which parts are used in a RoboCup competition, the usage shall be announced in the SPL mailing list (currently robocup-nao@cc.gatech.edu) one month before the first competition in which you are using it. The announcement shall name which parts of this code are used. It shall also contain a description of the own contribution that addresses the criterions mentioned above.
  5. If you are using this source code or parts of this source code and happen to meet members of B-Human at a RoboCup competition, please provide these members with a few bottles of your favorite beer.
  6. Bug fixes regarding existing code shall be sent back to B-Human via GitHub pull request (https://github.com/bhuman).

THIS SOFTWARE IS PROVIDED BY B-HUMAN ``AS IS’’ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL B-HUMAN NOR ITS MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ——————————————————————

Stopwatch

Easy to use simple benchmarking tool.

Sends UDP packets to localhost, which StopwatchViewer receives and displays stats on, including plots (credit to Fiachra Matthews here).

StopwatchViewer needs Qt4 to build. Simply include Stopwatch.h in whatever code you want to benchmark and use as such;

#include <string>
#include <stdio.h>
#include "Stopwatch.h"

int main(int argc, char *argv[])
{
  //This stops duplicate timings on multiple runs
  Stopwatch::getInstance().setCustomSignature(32434);

  STOPWATCH("Timing1",

  if(argc >= 1)
  {
    sleep(1);
  }

  );


  TICK("Timing2");

  while(argc > 0)
  {
    sleep(2);
    argc--;
  }

  TOCK("Timing2");

  Stopwatch::getInstance().sendAll();
}

Then just watch the stats in StopwatchViewer.

Uses some code from the B-Human code release (http://www.b-human.de/).

Original page: https://github.com/strands-project/strands_3d_mapping/blob/hydro-devel/dynamic_object_retrieval/dynamic_object_retrieval/stopwatch/README.md