diff -r f345bda72bc4 -r 43e37759235e Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_single_request_8cpp-source.html --- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_single_request_8cpp-source.html Tue Mar 30 11:56:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ - -
-00001 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). -00002 // All rights reserved. -00003 // This component and the accompanying materials are made available -00004 // under the terms of "Eclipse Public License v1.0" -00005 // which accompanies this distribution, and is available -00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". -00007 // -00008 // Initial Contributors: -00009 // Nokia Corporation - initial contribution. -00010 // -00011 // Contributors: -00012 // -00013 // Description: -00014 // Shows asynchronous programming (without active objects). -00015 // Example shows how a single request can be issued, followed -00016 // by User::WaitForRequest() -00017 // -00018 -00019 -00020 #include "CommonFramework.h" -00021 -00022 -00023 -00024 // Do the example -00025 LOCAL_C void doExampleL() -00026 { -00027 // create and initialize heartbeat timer -00028 RTimer heartbeat; // heartbeat timer -00029 -00030 TRequestStatus heartbeatStatus; // request status associated with it -00031 heartbeat.CreateLocal(); // always created for this thread -00032 -00033 // go round timing loop -00034 for (TInt i=0; i<10; i++) -00035 { -00036 // issue and wait for single request -00037 heartbeat.After(heartbeatStatus,1000000); // wait 1 second -00038 User::WaitForRequest(heartbeatStatus); // wait for request -00039 // to complete -00040 // say we're here -00041 _LIT(KFormatString1,"Tick %d\n"); -00042 console->Printf(KFormatString1, i); -00043 } -00044 -00045 // close timer -00046 heartbeat.Close(); // close timer -00047 } -