wut  v1.7.0
Wii U Toolchain
stopwatch.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wut.h>
4 #include "spinlock.h"
5 #include "time.h"
6 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef struct OSStopwatch OSStopwatch;
18 
20 {
24  const char *name;
26  uint32_t hitCount;
37  WUT_PADDING_BYTES(0x4);
38 };
39 WUT_CHECK_OFFSET(OSStopwatch, 0x00, lock);
40 WUT_CHECK_OFFSET(OSStopwatch, 0x10, name);
41 WUT_CHECK_OFFSET(OSStopwatch, 0x14, hitCount);
42 WUT_CHECK_OFFSET(OSStopwatch, 0x18, totalTime);
43 WUT_CHECK_OFFSET(OSStopwatch, 0x20, minTime);
44 WUT_CHECK_OFFSET(OSStopwatch, 0x28, maxTime);
45 WUT_CHECK_OFFSET(OSStopwatch, 0x30, startTime);
46 WUT_CHECK_OFFSET(OSStopwatch, 0x38, running);
47 WUT_CHECK_SIZE(OSStopwatch, 0x40);
48 
53 void
55  const char *name);
56 
60 void
62 
67 void
69 
74 void
76 
80 OSTime
82 
86 void
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
OSTime totalTime
Total time from first start to last stop.
Definition: stopwatch.h:28
OSTime minTime
Minimum time between stops.
Definition: stopwatch.h:30
uint32_t hitCount
Number of times the stopwatch has been stopped.
Definition: stopwatch.h:26
BOOL running
Whether the stopwatch is running.
Definition: stopwatch.h:36
const char * name
Tag.
Definition: stopwatch.h:24
OSSpinLock lock
Lock.
Definition: stopwatch.h:22
OSTime maxTime
Maximum time between stops.
Definition: stopwatch.h:32
OSTime startTime
Last time the watch was started.
Definition: stopwatch.h:34
void OSInitStopwatch(OSStopwatch *stopwatch, const char *name)
Initialises the stopwatch, stopwatches must be initialized before any other stopwatch functions are u...
void OSStartStopwatch(OSStopwatch *stopwatch)
Starts the stopwatch.
void OSStopStopwatch(OSStopwatch *stopwatch)
Stops the stopwatch and increments hit count.
OSTime OSCheckStopwatch(OSStopwatch *stopwatch)
Returns the total time the stopwatch has been running.
void OSDumpStopwatch(OSStopwatch *stopwatch)
Dumps stopwatch info to the Cafe OS warn log.
void OSResetStopwatch(OSStopwatch *stopwatch)
Resets all stopwatch data.
int64_t OSTime
Definition: time.h:18
int32_t BOOL
Definition: wut_types.h:7