messagingfw/msgtestfw/TestActions/Performance/Src/CMtfTestActionStopTimer.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include <e32std.h>
       
    21 #include "CMtfTestActionStopTimer.h"
       
    22 #include "CMtfTestActionManager.h"
       
    23 #include "CMtfTestCase.h"
       
    24 #include "CMtfTestActionParameters.h"
       
    25 
       
    26 
       
    27 CMtfTestAction* CMtfTestActionStopTimer::NewL(CMtfTestCase& aTestCase,
       
    28 		CMtfTestActionParameters* aActionParameters)
       
    29 	{
       
    30 	CMtfTestActionStopTimer* self = new (ELeave) CMtfTestActionStopTimer(aTestCase);
       
    31 	CleanupStack::PushL(self);
       
    32 	self->ConstructL(aActionParameters);
       
    33 	CleanupStack::Pop();
       
    34 	return self;
       
    35 	}
       
    36 	
       
    37 CMtfTestActionStopTimer::CMtfTestActionStopTimer(CMtfTestCase& aTestCase)
       
    38 : CMtfSynchronousTestAction(aTestCase)
       
    39 	{
       
    40 	}
       
    41 
       
    42 void CMtfTestActionStopTimer::ExecuteActionL()
       
    43 	{
       
    44 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionStopTimer);
       
    45 	
       
    46 
       
    47 	TTime* time=ObtainParameterReferenceL<TTime>(TestCase(),ActionParameters().Parameter(0));
       
    48 //	TInt64* time=ObtainParameterReferenceL<TInt64>(TestCase(),ActionParameters().Parameter(0));
       
    49 	TTime start(*time);
       
    50 	TTime end;
       
    51 	end.UniversalTime();
       
    52 	TInt64 interval = end.MicroSecondsFrom(start).Int64();
       
    53 	interval /= 1000; // ms
       
    54 		
       
    55 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionStopTimer);
       
    56 	TestCase().INFO_PRINTF2(_L("time (ms)=%d"),interval);
       
    57 	TestCase().ActionCompletedL(*this);
       
    58 	}
       
    59 
       
    60 CMtfTestActionStopTimer::~CMtfTestActionStopTimer()
       
    61 	{
       
    62 	}