File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
exercises/split-second-stopwatch Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,25 @@ The stopwatch has the following functionality:
9
9
- Previous laps: retrieve the previously recorded lap times
10
10
- Reset: stop time tracking, reset the current lap, and clear all previously recorded laps
11
11
- Lap: add the current lap time to the previous laps, then reset the current lap time and continue tracking time
12
+
13
+ You can think of a stopwatch as being in one of three states:
14
+
15
+ 1 . Ready
16
+ 2 . Running (tracking time)
17
+ 3 . Stopped (not tracking time)
18
+
19
+ This is a visualization of the states (between square brackets) and the commands (between angular brackets):
20
+
21
+ ``` text
22
+ <lap>
23
+ +-----+
24
+ | |
25
+ <start> v | <stop>
26
+ [Ready] ---------> [Running] --------> [Stopped]
27
+ ^ ^ | |
28
+ | | <start> | |
29
+ | +------------------------+ |
30
+ | |
31
+ | <reset> |
32
+ +-----------------------------------------+
33
+ ```
You can’t perform that action at this time.
0 commit comments