use megabytes instead of bytes

Signed-off-by: Aoi K <koizumi.aoi@kyoko-project.wer.ee>

git-svn-id: file:///srv/svn/repo/mima/trunk@14 d2428f92-30f9-164c-8098-19ee57ce342c
This commit is contained in:
koizumi.aoi 2022-11-15 12:38:49 +00:00
parent f3fe6b0a3e
commit 5b2122b86f

View File

@ -22,6 +22,9 @@ func main() {
hours := (uptime - (days * 60 * 60 * 24)) / (60 * 60)
minutes := ((uptime - (days * 60 * 60 * 24)) - (hours * 60 * 60)) / 60
free_mem := v.Free / 1024 / 1024
total_mem := v.Total / 1024 / 1024
if err != nil {
log.Fatal(err)
}
@ -31,7 +34,7 @@ func main() {
fmt.Printf("Editor:\t%s\n", os.Getenv("EDITOR"))
fmt.Printf("System:\t%s\n", runtime.GOOS)
fmt.Printf("Architecture:\t%s\n", runtime.GOARCH)
fmt.Printf("RAM:\t%v/%v (%f%%)\n", v.Total, v.Free, v.UsedPercent)
fmt.Printf("RAM:\t%vM/%vM (%f%%)\n", free_mem, total_mem, v.UsedPercent)
fmt.Printf("Shell:\t%s\n", os.Getenv("SHELL"))
fmt.Printf("Uptime:\t%dd:%dh:%dm\n", days, hours, minutes)
}