cbowns / cpu-history
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
800185f
Christopher Bowns (author)
Sun Nov 09 15:58:58 -0800 2008
cpu-history / CPUInfo.h
| 9216220d » | Christopher Bowns | 2008-01-20 | 1 | /* | |
| 5b2cc24e » | Christopher Bowns | 2008-01-20 | 2 | * CPU History | |
| 9216220d » | Christopher Bowns | 2008-01-20 | 3 | * Christopher Bowns, 2008 | |
| 4 | */ | ||||
| 438ef25f » | Christopher Bowns | 2008-01-08 | 5 | // | |
| c43fc8a8 » | Christopher Bowns | 2008-01-17 | 6 | // CPUInfo.h | |
| 438ef25f » | Christopher Bowns | 2008-01-08 | 7 | // CPU Usage | |
| 8 | // | ||||
| 9 | // Created by Peter Hosey on 2006-06-21. | ||||
| 10 | // Copyright 2006 Peter Hosey. All rights reserved. | ||||
| 11 | // | ||||
| a79db69f » | Christopher Bowns | 2008-01-20 | 12 | // Modified by Christopher Bowns, starting 2008-1-1. | |
| 438ef25f » | Christopher Bowns | 2008-01-08 | 13 | ||
| 14 | #import <Cocoa/Cocoa.h> | ||||
| 15 | |||||
| 16 | #include <mach/mach.h> | ||||
| 17 | #include <mach/processor_info.h> | ||||
| 18 | #include <mach/mach_host.h> | ||||
| 19 | |||||
| 466ca6fe » | Christopher Bowns | 2008-01-08 | 20 | typedef struct cpudata { | |
| 21 | double user; | ||||
| 22 | double sys; | ||||
| 23 | double nice; | ||||
| 24 | double idle; | ||||
| d07654b6 » | Christopher Bowns | 2008-01-09 | 25 | } CPUData, *CPUDataPtr; | |
| 438ef25f » | Christopher Bowns | 2008-01-08 | 26 | ||
| 715583d1 » | Christopher Bowns | 2008-01-17 | 27 | @interface CPUInfo : NSObject { | |
| bce1e674 » | Christopher Bowns | 2008-02-01 | 28 | processor_cpu_load_info_t lastProcessorInfo; | |
| b18ccac7 » | Christopher Bowns | 2008-01-19 | 29 | mach_msg_type_number_t numLastProcessorInfo; | |
| 438ef25f » | Christopher Bowns | 2008-01-08 | 30 | unsigned numCPUs; | |
| bce1e674 » | Christopher Bowns | 2008-02-01 | 31 | CPUDataPtr *allcpudata; | |
| 2a4b78a3 » | Christopher Bowns | 2008-01-18 | 32 | int size; | |
| 33 | int inptr; | ||||
| 34 | int outptr; | ||||
| 438ef25f » | Christopher Bowns | 2008-01-08 | 35 | } | |
| 36 | |||||
| 715583d1 » | Christopher Bowns | 2008-01-17 | 37 | - (CPUInfo *)initWithCapacity:(unsigned)numItems; | |
| d07654b6 » | Christopher Bowns | 2008-01-09 | 38 | - (void)refresh; | |
| bce1e674 » | Christopher Bowns | 2008-02-01 | 39 | - (unsigned)numCPUs; | |
| 430b4267 » | Christopher Bowns | 2008-04-20 | 40 | - (void)startForwardIterate; | |
| 41 | - (void)startBackwardIterate; | ||||
| bce1e674 » | Christopher Bowns | 2008-02-01 | 42 | - (BOOL)getNext:(CPUDataPtr)ptr forCPU:(unsigned)cpu; | |
| 430b4267 » | Christopher Bowns | 2008-04-20 | 43 | - (BOOL)getPrev:(CPUDataPtr)ptr forCPU:(unsigned)cpu; | |
| bce1e674 » | Christopher Bowns | 2008-02-01 | 44 | - (void)getCurrent:(CPUDataPtr)ptr forCPU:(unsigned)cpu; | |
| 45 | - (void)getLast:(CPUDataPtr)ptr forCPU:(unsigned)cpu; | ||||
| d07654b6 » | Christopher Bowns | 2008-01-09 | 46 | - (int)getSize; | |
| 47 | |||||
| 438ef25f » | Christopher Bowns | 2008-01-08 | 48 | @end | |
