persistentstorage/centralrepository/test/testexecute/performance/src/TE_PerfTestUtilities.cpp
branchRCL_3
changeset 24 cc28652e0254
parent 0 08ec8eefde2f
equal deleted inserted replaced
23:26645d81f48d 24:cc28652e0254
       
     1 // Copyright (c) 2006-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 #include "TE_PerfTestUtilities.h"
       
    17 #include "srvdefs.h"
       
    18 #include <hal.h>
       
    19 #include <hal_data.h>
       
    20 
       
    21 TReal FastCountToMillisecondsInReal(TInt aFastCount)
       
    22 	{
       
    23 	TInt freqInHz;
       
    24 	HAL::Get(HAL::EFastCounterFrequency, freqInHz);
       
    25 	TReal freqInkHz = (TReal)freqInHz / 1000;
       
    26 	return (TReal)aFastCount / freqInkHz;
       
    27 	}
       
    28 
       
    29 TReal FastCountToMicrosecondsInReal(TInt aFastCount)
       
    30 	{
       
    31 	TInt freqInHz;
       
    32 	HAL::Get(HAL::EFastCounterFrequency, freqInHz);
       
    33 	TReal freqInkHz = (TReal)freqInHz / 1000000LL;
       
    34 	return (TReal)aFastCount / freqInkHz;
       
    35 	}
       
    36 
       
    37 TUint64 FastCountToMillisecondsInInt(TInt aFastCount)
       
    38 	{
       
    39 	TInt freqInHz;
       
    40 	HAL::Get(HAL::EFastCounterFrequency, freqInHz);
       
    41 	return (aFastCount*1000LL)/freqInHz;
       
    42 	}
       
    43 
       
    44 TUint64 FastCountToMicrosecondsInInt(TInt aFastCount)
       
    45 	{
       
    46 	TInt freqInHz;
       
    47 	HAL::Get(HAL::EFastCounterFrequency, freqInHz);
       
    48 	return (aFastCount*1000000LL)/freqInHz;
       
    49 	}
       
    50 
       
    51 TInt FreeRamSize()
       
    52 	{
       
    53 	TInt freeRamSize = 0;
       
    54 	
       
    55 	HAL::Get(HALData::EMemoryRAMFree, freeRamSize);
       
    56 	
       
    57 	return freeRamSize;
       
    58 	}
       
    59