home *** CD-ROM | disk | FTP | other *** search
- csh> cat test.c
- #include "pmplib.h"
-
- main()
- {
- int i;
- int j;
-
- /* pmpstartsig(1000): set the timer for every 1 millisecond. */
- /* P: produce profiling information. */
- /* pmp("test.out"): save pmp's results in test.out. */
-
- pmpstartsig(1000);
-
- for (i = 0;i < 1000;i++)
- {
- P;
- for (j = 0;j < 1000;j++)
- {
- P;
- if (i % 2)
- P;
- }
- }
- pmp("test.out");
- }
- csh> cc -o test test.c pmplib.o
- csh> ./test
- csh> pmp test.c test.out
- #include "pmplib.h"
-
- main()
- {
- int i;
- int j;
-
- /* pmpstartsig(1000): set the timer for every 1 millisecond. */
- /* P: produce profiling information. */
- /* pmp("test.out"): save pmp's results in test.out. */
-
- pmpstartsig(1000);
-
- for (i = 0;i < 1000;i++)
- {
- P; /* 1000+0 */
- for (j = 0;j < 1000;j++)
- {
- P; /* 1000000+243 */
- if (i % 2)
- P; /* 500000+105 */
- }
- }
- pmp("test.out");
- }
- csh>
-