优化性能
This commit is contained in:
6
main.js
6
main.js
@@ -144,7 +144,7 @@ app.whenReady().then(() => {
|
||||
console.error('设置窗口边界时出错:', error)
|
||||
}
|
||||
}
|
||||
}, 2000)
|
||||
}, 1000)
|
||||
|
||||
// 通知渲染进程窗口已失焦
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
@@ -261,7 +261,7 @@ function createTray() {
|
||||
|
||||
// 启动GPU监控
|
||||
function startGpuMonitoring() {
|
||||
// 每秒获取一次GPU信息
|
||||
// 每5秒获取一次GPU信息,减少性能开销
|
||||
gpuMonitorInterval = setInterval(async () => {
|
||||
try {
|
||||
// 尝试使用nvidia-smi命令获取GPU信息
|
||||
@@ -302,5 +302,5 @@ function startGpuMonitoring() {
|
||||
} catch (error) {
|
||||
console.error('获取GPU信息时出错:', error)
|
||||
}
|
||||
}, 200) // 每秒更新一次
|
||||
}, 200) // 每5秒更新一次
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user