ITK/Examples/Utilities/TimeProbe: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
No edit summary
(Deprecated content that is moved to sphinx)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
==TimeProbe.cxx==
{{warning|1=The media wiki content on this page is no longer maintained.  The examples presented on the https://itk.org/Wiki/*  pages likely require ITK version 4.13 or earlier releases.  In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.
<source lang="cpp">
}}
#include "itkTimeProbe.h"


#include <iostream>
[https://itk.org/ITKExamples[ITK Sphinx Examples]]
#include <string>
 
static void LongFunction();
 
int main(int, char *[])
{
  itk::TimeProbe clock;
 
  clock.Start();
  LongFunction();
 
  clock.Stop();
  std::cout << "Mean: " << clock.GetMean() << std::endl;
  std::cout << "Total: " << clock.GetTotal() << std::endl;
 
  clock.Start();
  LongFunction();
 
  clock.Stop();
  std::cout << "Mean: " << clock.GetMean() << std::endl;
  std::cout << "Total: " << clock.GetTotal() << std::endl;
 
  return EXIT_SUCCESS;
}
 
void LongFunction()
{
  for(int i = 0; i < 1e8; i++)
  {
    double a = 0;
  }
}
</source>
 
{{ITKCMakeLists|TimeProbe|}}

Latest revision as of 18:10, 31 May 2019

Warning: The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releases. In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.

[ITK Sphinx Examples]