Skip to content

Commit 4aff653

Browse files
committed
Update documentation
1 parent bb25831 commit 4aff653

File tree

3 files changed

+62
-4
lines changed

3 files changed

+62
-4
lines changed

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# NeverIdle
22

3+
[**English**](README_en.md) | **简体中文**
4+
35
*我喜欢你,但别删我机,好么?*
46

57
本程序随手写的,下面介绍也是随心写的,不喜勿碰。
@@ -25,16 +27,16 @@ MJJ 们估计会喜欢这个。感谢脚本作者 @Ansen
2527
命令参数:
2628

2729
```shell
28-
./NeverIdle -c 2h -m 2 -n 4h
30+
./NeverIdle -cp 0.15 -m 2 -n 4h
2931
```
3032

3133
其中:
3234

3335
-c 指启用 CPU 定期浪费,后面跟随每次浪费的间隔时间。
34-
如每 12 小时 23 分钟 34 秒浪费一次,则为 12h23m34s。按照格式填。
36+
如每 12 小时 23 分钟 34 秒浪费一次,则为 `-c 12h23m34s`。按照格式填。
3537

3638
-cp 指启用粗粒度的 CPU 百分比浪费,浪费率将随机器的使用水平实时变化。
37-
如最大浪费20%的CPU,则为 -cp 0.2。百分比的取值范围 [0, 1] 并且注意不要和 `-c` 一起使用。
39+
如最大浪费20%的CPU,则为 `-cp 0.2`。百分比的取值范围 [0, 1] 并且注意不要和 `-c` 一起使用。
3840

3941
-m 指启用浪费的内存量,后面是一个数字,单位为 GiB。
4042
启动后会占用对应量的内存,并且保持不会释放,直到手动杀死进程。

README_en.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# NeverIdle
2+
3+
**English** | [**简体中文**](README.md)
4+
5+
*I love you, but do not stop my machine, could you?*
6+
7+
---
8+
9+
**To non-Chinese users:**
10+
11+
Thank you for liking this program! :-P
12+
I invented this to share among my Chinese friends at first, but I didn't expect it to become popular in the world.
13+
Also, I'm sorry for the late official English README! Now just enjoy it. :-D
14+
15+
If you need help, Google first, and then go to the issue.
16+
I speak Chinese and English. For other languages, please translate before asking questions. :)
17+
18+
---
19+
20+
## Usage
21+
22+
Download executable file from Release. Note the distinction between amd64 and arm64.
23+
24+
Start a screen on the server and run it.
25+
If you want to learn about screen command, just Google.
26+
27+
Command arguments:
28+
29+
```shell
30+
./NeverIdle -cp 0.15 -m 2 -n 4h
31+
```
32+
33+
In which:
34+
35+
-c enables CPU periodic waste, followed by the interval between wastes.
36+
E.g. waste CPU every 12 hours 23 minutes and 34 seconds, then the argument would be `-c 12h23m34s`.
37+
Just follow this template.
38+
39+
-cp enables coarse-grained CPU percentage waste, and the waste rate will change in real time with the usage level of the machine.
40+
If the maximum waste of 20% of the CPU is `-cp 0.2`. The value range of percentage is [0, 1] and be careful not to use it with `-c`.
41+
42+
-m enables memory waste, followed by a number in GiB.
43+
After startup, the specified amount of memory will be occupied and will not be released until the process is killed.
44+
45+
-n enables network(bandwidth) periodic waste, followed by the interval between wastes.
46+
Argument format is the same as `-c`. The Ookla Speed Test will be performed periodically (and the results will be output!)
47+
48+
-t specifics the number of concurrent connections of the network periodic waste.
49+
The default is 10. The larger the value, the more resources will be consumed. For most situations, it does not need to be changed.
50+
51+
-p specifics the process priority, followed by a priority value. If not specified, the lowest priority of the platform will be used by default.
52+
For UNIX-like systems (such as Linux, FreeBSD, and macOS), the value range is [-20,19], and the higher the number, the lower the priority.
53+
For Windows, see [the official documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setpriorityclass).
54+
It is recommended not to specify because the default is the lowest priority, making way for all other processes.
55+
56+
*All the functions you configured will be executed once immediately when you start the program, so you can take a look at the effect.*

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package main
33
import (
44
"flag"
55
"fmt"
6-
"github.com/layou233/neveridle/controller"
76
"math/rand"
87
"runtime"
98
"time"
109

10+
"github.com/layou233/neveridle/controller"
1111
"github.com/layou233/neveridle/waste"
1212
)
1313

0 commit comments

Comments
 (0)