SessionCtl // Show memory usage when debug mode is ON.

This commit is contained in:
ShikiSuen 2023-11-27 23:50:26 +08:00
parent 334e6e0ad5
commit eb68454d8d
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,11 @@ extension SessionCtl {
let menu = NSMenu(title: "Input Method Menu")
var silentMode: Bool { clientBundleIdentifier == "com.apple.SecurityAgent" }
if PrefMgr.shared.isDebugModeEnabled, let currentMemorySizeInBytes = NSApplication.memoryFootprint {
let currentMemorySize: Double = (Double(currentMemorySizeInBytes) / 1024 / 1024).rounded(toPlaces: 1)
menu.addItem(withTitle: "Total RAM Usage: \(currentMemorySize)MB", action: nil, keyEquivalent: "")
}
let switchInputModeItem = menu.addItem(
withTitle: String(
format: "Switch to %@ Input Mode".localized,