- Timestamp:
- Jul 30, 2001, 3:56:28 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/test/PrfTstProcess.c
r6404 r6405 1 /* $Id: PrfTstProcess.c,v 1. 1 2001-07-30 00:43:19bird Exp $1 /* $Id: PrfTstProcess.c,v 1.2 2001-07-30 01:56:28 bird Exp $ 2 2 * 3 3 * Test program which checks how long it takes to execute another … … 9 9 * 10 10 */ 11 12 /** @design Process Startup and Termination cost. 13 * 14 * The purpose is to compare the cost of creating a child process on different 15 * platforms; revealing which is the best ones... 16 * 17 * Later analysis on why will be done I hope... 18 * 19 * 20 * @subsection Test Results 21 * 22 * Linux version 2.4.5 (SMP) Pentium III 700Mhz- GCC: 23 * 0.001845 - 0.001845 sec (pid=193c) 24 * 0.001832 - 0.001832 sec (pid=193e) 25 * 0.001792 - 0.001792 sec (pid=1940) 26 * 0.001899 - 0.001899 sec (pid=1942) 27 * 28 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - Watcom -Otx: 29 * 5150.000000 - 0.004316 sec (pid=0) 30 * 5175.000000 - 0.004337 sec (pid=0) 31 * 5143.000000 - 0.004310 sec (pid=0) 32 * 5181.000000 - 0.004342 sec (pid=0) 33 * 34 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - Watcom (no optimization): 35 * 5510.000000 - 0.004618 sec (pid=0) 36 * 5500.000000 - 0.004610 sec (pid=0) 37 * 5489.000000 - 0.004600 sec (pid=0) 38 * 5551.000000 - 0.004652 sec (pid=0) 39 * 40 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - VAC308: 41 * 6490.000000 - 0.005439 sec (pid=0) 42 * 6465.000000 - 0.005418 sec (pid=0) 43 * 6501.000000 - 0.005449 sec (pid=0) 44 * 6496.000000 - 0.005444 sec (pid=0) 45 * 46 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - VAC365: 47 * 6743.000000 - 0.005651 sec (pid=0) 48 * 6694.000000 - 0.005610 sec (pid=0) 49 * 6705.000000 - 0.005619 sec (pid=0) 50 * 7025.000000 - 0.005888 sec (pid=0) 51 * 52 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - EMX -D__OS2__: 53 * 15339.000000 - 0.012856 sec (pid=0) 54 * 15507.000000 - 0.012997 sec (pid=0) 55 * 15224.000000 - 0.012759 sec (pid=0) 56 * 15714.000000 - 0.013170 sec (pid=0) 57 * 58 * OS/2 WS4eB 4.5 FP 2 (SMP) Pentium III 600Mhz - EMX -D__OS2__ -D__NOTPC__: 59 * 31992.000000 - 0.026813 sec (pid=1c7f) 60 * 32300.000000 - 0.027071 sec (pid=1c82) 61 * 31699.000000 - 0.026567 sec (pid=1c85) 62 * 33570.000000 - 0.028135 sec (pid=1c88) 63 * 64 */ 65 11 66 #include <stdio.h> 12 #include <sys\time.h> 67 #include <sys/time.h> 68 #ifndef __NOTPC__ 13 69 #include <process.h> 14 70 #endif 15 71 16 72 #ifdef __OS2__ 17 #define INCL_DOSMISC18 73 #define INCL_DOSPROFILE 19 74 #include <os2.h> … … 21 76 long double gettime(void) 22 77 { 23 #if 024 ULONG ul = 0;25 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ul, sizeof(ul));26 #else27 78 QWORD qw; 28 79 DosTmrQueryTime(&qw); 29 80 return (long double)qw.ulHi * (4294967296.00) + qw.ulLo; 30 #endif31 81 } 32 82 33 83 unsigned getHz(void) 34 84 { 35 #if 036 return 1000;37 #else38 85 ULONG ul = -1; 39 86 DosTmrQueryFreq(&ul); 40 87 return ul; 41 #endif42 88 } 89 90 91 #elif defined(__WINNT__) 92 /* 93 * Windows 94 */ 95 unsigned long __stdcall GetTickCount(void); 96 97 long double gettime(void) 98 { 99 return (long double)GetTickCount(); 100 } 101 102 unsigned getHz(void) 103 { 104 return 1000; 105 } 106 43 107 44 108 #else … … 64 128 int main(int argc, char **argv) 65 129 { 66 long double rdStart; 67 long double rdEnd; 68 int pid; 69 #ifndef UNIX 70 #else 71 int status; 130 long double rdStart; 131 long double rdEnd; 132 int pid; 133 #ifdef __NOTPC__ 134 int status; 72 135 #endif 73 136 … … 82 145 */ 83 146 rdStart = gettime(); 84 #ifndef UNIX85 pid = spawnl(P_WAIT, argv[0], argv[0], "child", NULL); 147 #ifndef __NOTPC__ 148 pid = spawnl(P_WAIT, argv[0], argv[0], "child", NULL); /* pid == 0 on success */ 86 149 #else 87 150 pid = fork();
Note:
See TracChangeset
for help on using the changeset viewer.