searchengine/util/tsrc/itk/src/itkperf.cpp
changeset 0 671dee74050a
equal deleted inserted replaced
-1:000000000000 0:671dee74050a
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /*
       
    18  * itkperf.cpp
       
    19  *
       
    20  *  Created on: Jun 3, 2009
       
    21  *      Author: admin
       
    22  */
       
    23 
       
    24 #include "itkperf.h"
       
    25 
       
    26 namespace Itk {
       
    27 
       
    28 	
       
    29 	Timestamper::Timestamper(const char    * name,
       
    30 				Itk::TestMgr  * testMgr)
       
    31 		: name_(name),
       
    32 		  testMgr_(testMgr)
       
    33 	{
       
    34 		Itk::getTimestamp(&begin_);
       
    35 	}
       
    36 
       
    37 
       
    38 	Timestamper::~Timestamper()
       
    39 	{
       
    40 		Itk::Timestamp end;
       
    41 		Itk::getTimestamp(&end);
       
    42 
       
    43 		long
       
    44 			millis = Itk::getElapsedMs(&end,
       
    45 									   &begin_);
       
    46 
       
    47 		ITK_REPORT(testMgr_,
       
    48 				   name_.c_str(),
       
    49 				   "%d ms",
       
    50 				   millis);
       
    51 	}
       
    52 
       
    53 
       
    54 }