Skip to content

Commit

Permalink
feat: continue work on showing the program's summary
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 10046c55b43b2a1f10fd2e7629550f3063ef360086b6204e282ecb2dd214c13e
  • Loading branch information
thindil committed Mar 22, 2024
1 parent 70a4912 commit 87cd9d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
## This is the main module of the program.

# Standard library imports
import std/[macros, os, strutils, times]
import std/[macros, os, strformat, strutils, times]
# External modules imports
import compiler/[idents, llstream, options, parser, pathutils]
import colored_logger
Expand Down Expand Up @@ -159,6 +159,12 @@ proc main() {.raises: [], tags: [ReadIOEffect, WriteIOEffect, RootEffect],
message(text = "========")
message(text = "SUMMARY:")
message(text = "Time taken: " & $(cpuTime() - startTime) & " sec(s)")
let memUsage: float = getMaxMem().float / 1048576.0
try:
message(text = "Max memory usage: {memUsage:06.3f} MiB".fmt)
except:
abortProgram(message = "Can't show the program max memory usage. Reason: ",
e = getCurrentException())
message(text = "Stopping nimalyzer.")
quit resultCode

Expand Down

0 comments on commit 87cd9d5

Please sign in to comment.