sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test/defrag/perf/t_timer.cpp sl@0: // sl@0: // sl@0: sl@0: #define __E32TEST_EXTENSION__ sl@0: #include sl@0: #include sl@0: sl@0: #include "t_perf.h" sl@0: sl@0: sl@0: const TInt CalAttempts = 100; sl@0: sl@0: void DefragLatency::CalibrateTimer(RTest& aTest) sl@0: { sl@0: TInt val = 0; sl@0: TUint time1, time2; sl@0: sl@0: HAL::Get(HAL::EFastCounterFrequency, iFastCounterFreq); sl@0: sl@0: /////////////////////////////////////////// sl@0: for (TInt i = 0; i < CalAttempts; i++) sl@0: { sl@0: time1 = GetFastCounter(); sl@0: time2 = GetFastCounter(); sl@0: if (time2 < time1) sl@0: aTest.Printf(_L("CALIBRATION ERROR !!!!!!!!!!!!11\n")); sl@0: val += time2 - time1; sl@0: } sl@0: iCalDelay = val / CalAttempts; sl@0: } sl@0: