sl@0: // Copyright (c) 1995-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\bench\t_exec.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: const TInt KHeapSize=0x2000; sl@0: const TInt KMajorVersionNumber=1; sl@0: const TInt KMinorVersionNumber=0; sl@0: const TInt KBuildVersionNumber=1; sl@0: sl@0: LOCAL_D RTest test(_L("T_EXEC")); sl@0: LOCAL_D RTest testSvr(_L("Server")); sl@0: LOCAL_D RSemaphore semmy; sl@0: LOCAL_D TInt speedCount; sl@0: sl@0: LOCAL_C TInt speedyThreadEntryPoint(TAny*) sl@0: // sl@0: // The entry point for the speed test thread. sl@0: // sl@0: { sl@0: sl@0: speedCount=0; sl@0: semmy.Signal(); sl@0: TUint myChar='a'; sl@0: TUint r; sl@0: for (TUint i=0;i<0xffffffff;i++) sl@0: { sl@0: r=User::UpperCase(myChar); sl@0: speedCount++; sl@0: } sl@0: return(KErrNone); sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: // sl@0: // Test timers. sl@0: // sl@0: { sl@0: sl@0: test.Title(); sl@0: test.Start(_L("Creating semaphore")); sl@0: TInt r=semmy.CreateLocal(0); sl@0: test(r==KErrNone); sl@0: // sl@0: test.Next(_L("Starting speedy thread")); sl@0: RThread speedy; sl@0: r=speedy.Create(_L("Speedy"),speedyThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,NULL); sl@0: test(r==KErrNone); sl@0: speedy.Resume(); sl@0: // sl@0: test.Next(_L("Wait for speedy to start")); sl@0: semmy.Wait(); sl@0: // sl@0: test.Printf(_L("Starting exec speed test...\n")); sl@0: User::After(0); sl@0: TInt b=speedCount; sl@0: User::After(1000000); sl@0: TInt n=speedCount; sl@0: test.Printf(_L("Count = %d exec calls in 1 second\n"),n-b); sl@0: // sl@0: test.Next(_L("Kill speedy")); sl@0: speedy.Kill(0x666); sl@0: speedy.Close(); sl@0: // sl@0: test.End(); sl@0: return(0); sl@0: } sl@0: