kerneltest/e32test/bench/t_r64bm.cpp
changeset 90 947f0dc9f7a8
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
52:2d65c2f76d7b 90:947f0dc9f7a8
    24 
    24 
    25 const TInt KHeapSize=0x2000;
    25 const TInt KHeapSize=0x2000;
    26 const TInt KAverageOverInSeconds=10;
    26 const TInt KAverageOverInSeconds=10;
    27 const TInt KNumberOfCalculationsPerLoop=10;
    27 const TInt KNumberOfCalculationsPerLoop=10;
    28 
    28 
    29 volatile TUint count;
    29 volatile TUint Count;
    30 #ifdef T_R64BM_WITH_VFP
    30 #ifdef T_R64BM_WITH_VFP
    31 RTest test(_L("T_VFPBM"));
    31 RTest test(_L("T_VFPBM"));
    32 #else
    32 #else
    33 RTest test(_L("T_R64BM"));
    33 RTest test(_L("T_R64BM"));
    34 #endif
    34 #endif
    56 		test.Printf(_L("Failed to create thread with error %d\n"),r);
    56 		test.Printf(_L("Failed to create thread with error %d\n"),r);
    57 		return(r);
    57 		return(r);
    58 		}
    58 		}
    59     thread.Resume();
    59     thread.Resume();
    60     User::After(1000000);
    60     User::After(1000000);
    61     count=0;
    61     TUint initial = Count;
    62     User::After(KAverageOverInSeconds*1000000);
    62     User::After(KAverageOverInSeconds*1000000);
    63     TUint64 result = count;
    63 	TUint final = Count;
       
    64     TUint64 result = TUint64(final - initial);
    64 	result *= TUint64(KNumberOfCalculationsPerLoop);
    65 	result *= TUint64(KNumberOfCalculationsPerLoop);
    65 	result /= TUint64(KAverageOverInSeconds);
    66 	result /= TUint64(KAverageOverInSeconds);
    66 	TUint r32 = (TUint)result;
    67 	TUint r32 = (TUint)result;
    67     thread.Kill(0);
    68     thread.Kill(0);
    68 	thread.Close();
    69 	thread.Close();