|
1 | 1 | --- |
2 | | -layout: default # jekyll-theme-minimal supplies this layout |
3 | | -title: CPU Load Generator |
| 2 | +layout: default # keeps jekyll‑theme‑minimal’s wrapper |
| 3 | +title: CPU Load Generator # still appears in browser tab |
4 | 4 | --- |
5 | 5 |
|
6 | | -<!-- lightweight, self‑contained styling --> |
7 | | -<style> |
8 | | - :root { |
9 | | - --accent: #0069d9; |
10 | | - --bg: #f7f9fc; |
11 | | - --text: #222; |
12 | | - --code-bg: #eee; |
13 | | - } |
14 | | - * { box-sizing: border-box; } |
15 | | - body { |
16 | | - margin: 0; |
17 | | - font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; |
18 | | - line-height: 1.6; |
19 | | - color: var(--text); |
20 | | - background: var(--bg); |
21 | | - } |
22 | | - header { |
23 | | - background: var(--accent); |
24 | | - color: #fff; |
25 | | - padding: 2rem 1rem; |
26 | | - text-align: center; |
27 | | - } |
28 | | - header h1 { margin: 0 0 .25rem; font-size: 2.25rem; } |
29 | | - header a { color: #fff; font-weight: 600; text-decoration: underline; } |
30 | | - main { |
31 | | - max-width: 58rem; |
32 | | - margin: 2rem auto; |
33 | | - padding: 0 1rem; |
34 | | - } |
35 | | - section { |
36 | | - background: #fff; |
37 | | - padding: 2rem 1.5rem; |
38 | | - border-radius: .85rem; |
39 | | - box-shadow: 0 2px 6px rgba(0,0,0,.08); |
40 | | - margin-bottom: 2rem; |
41 | | - } |
42 | | - h2 { margin-top: 0; color: var(--accent); } |
43 | | - h3, h4 { color: var(--accent); margin-bottom: .25rem; } |
44 | | - img { max-width: 100%; height: auto; border-radius: .5rem; } |
45 | | - ul { padding-left: 1.25rem; } |
46 | | - pre, code { |
47 | | - font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; |
48 | | - background: var(--code-bg); |
49 | | - border-radius: .35rem; |
50 | | - } |
51 | | - pre { padding: .75rem 1rem; overflow-x: auto; } |
52 | | - footer { |
53 | | - text-align: center; |
54 | | - padding: 1rem; |
55 | | - font-size: .9rem; |
56 | | - color: #666; |
57 | | - } |
58 | | -</style> |
59 | | - |
60 | | -<header> |
| 6 | +<header class="hero"> |
61 | 7 | <h1>CPU Load Generator</h1> |
62 | 8 | <p> |
63 | | - Generate a fixed, precisely regulated CPU load with a lean Python script that uses a PID controller.<br /> |
| 9 | + Generate a fixed, precisely regulated CPU load with a lean Python script that uses a PID controller.<br> |
64 | 10 | <a href="https://github.com/GaetanoCarlucci/CPULoadGenerator" |
65 | | - target="_blank" rel="noopener">View the project on GitHub ↗︎</a> |
| 11 | + target="_blank" rel="noopener">View the project on GitHub ↗︎</a> |
66 | 12 | </p> |
67 | 13 | </header> |
68 | 14 |
|
@@ -112,7 +58,7 @@ <h3>Controller Thread</h3> |
112 | 58 | <pre><code># actuator snippet |
113 | 59 | def generate_load(self, sleep_time): |
114 | 60 | interval = time.time() + self.period - sleep_time |
115 | | - while time.time() < interval: |
| 61 | + while time.time() < interval: |
116 | 62 | pr = 213123 # busy‑work |
117 | 63 | _ = pr * pr |
118 | 64 | pr = pr + 1 |
|
0 commit comments