00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "copyright.h"
00011 #include "utility.h"
00012 #include "stats.h"
00013
00014
00015
00016
00017
00018
00019 Statistics::Statistics()
00020 {
00021 totalTicks = idleTicks = systemTicks = userTicks = 0;
00022 numDiskReads = numDiskWrites = 0;
00023 numConsoleCharsRead = numConsoleCharsWritten = 0;
00024 numPageFaults = numPacketsSent = numPacketsRecvd = 0;
00025 }
00026
00027
00028
00029
00030
00031
00032
00033 void
00034 Statistics::Print()
00035 {
00036 printf("Ticks: total %d, idle %d, system %d, user %d\n", totalTicks,
00037 idleTicks, systemTicks, userTicks);
00038 printf("Disk I/O: reads %d, writes %d\n", numDiskReads, numDiskWrites);
00039 printf("Console I/O: reads %d, writes %d\n", numConsoleCharsRead,
00040 numConsoleCharsWritten);
00041 printf("Paging: faults %d\n", numPageFaults);
00042 printf("Network I/O: packets received %d, sent %d\n", numPacketsRecvd,
00043 numPacketsSent);
00044 }
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees