1 /****************************************************************************
3 * SciTech OS Portability Manager Library
5 * ========================================================================
7 * The contents of this file are subject to the SciTech MGL Public
8 * License Version 1.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of
10 * the License at http://www.scitechsoft.com/mgl-license.txt
12 * Software distributed under the License is distributed on an
13 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * rights and limitations under the License.
17 * The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
19 * The Initial Developer of the Original Code is SciTech Software, Inc.
20 * All Rights Reserved.
22 * ========================================================================
27 * Description: Test program for the PM_blockUntilTimeout function.
29 ****************************************************************************/
34 #define DELAY_MSECS 1100
37 /*-------------------------- Implementation -------------------------------*/
39 /* The following routine takes a long count in microseconds and outputs
40 * a string representing the count in seconds. It could be modified to
41 * return a pointer to a static string representing the count rather
42 * than printing it out.
45 void ReportTime(ulong count)
49 secs = count / 1000000L;
50 count = count - secs * 1000000L;
51 printf("Time taken: %lu.%06lu seconds\n",secs,count);
58 printf("Detecting processor information ...");
60 printf("\n\n%s\n", CPU_getProcessorName());
63 for (i = 0; i < LOOPS; i++) {
64 PM_blockUntilTimeout(DELAY_MSECS);
65 ReportTime(LZTimerLap());