Changeset 6405 for trunk/src


Ignore:
Timestamp:
Jul 30, 2001, 3:56:28 AM (24 years ago)
Author:
bird
Message:

More coding. Results.

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:19 bird Exp $
     1/* $Id: PrfTstProcess.c,v 1.2 2001-07-30 01:56:28 bird Exp $
    22 *
    33 * Test program which checks how long it takes to execute another
     
    99 *
    1010 */
     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
    1166#include <stdio.h>
    12 #include <sys\time.h>
     67#include <sys/time.h>
     68#ifndef __NOTPC__
    1369#include <process.h>
    14 
     70#endif
    1571
    1672#ifdef __OS2__
    17 #define INCL_DOSMISC
    1873#define INCL_DOSPROFILE
    1974#include <os2.h>
     
    2176long double gettime(void)
    2277{
    23 #if 0
    24     ULONG ul = 0;
    25     DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ul, sizeof(ul));
    26 #else
    2778    QWORD   qw;
    2879    DosTmrQueryTime(&qw);
    2980    return (long double)qw.ulHi * (4294967296.00) + qw.ulLo;
    30 #endif
    3181}
    3282
    3383unsigned getHz(void)
    3484{
    35 #if 0
    36     return 1000;
    37 #else
    3885    ULONG ul = -1;
    3986    DosTmrQueryFreq(&ul);
    4087    return ul;
    41 #endif
    4288}
     89
     90
     91#elif defined(__WINNT__)
     92/*
     93 * Windows
     94 */
     95unsigned long __stdcall GetTickCount(void);
     96
     97long double gettime(void)
     98{
     99    return (long double)GetTickCount();
     100}
     101
     102unsigned getHz(void)
     103{
     104    return 1000;
     105}
     106
    43107
    44108#else
     
    64128int main(int argc, char **argv)
    65129{
    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;
    72135    #endif
    73136
     
    82145     */
    83146    rdStart = gettime();
    84     #ifndef UNIX
    85     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 */
    86149    #else
    87150    pid = fork();
Note: See TracChangeset for help on using the changeset viewer.