为什么 delphi ide 增加 windows 平台计时器分辨率?
why does the delphi ide increase the windows platform timer resolution?
我注意到,每当我打开 delphi 2010 ide 时,笔记本电脑的电池寿命就会明显变差。当我 powercfg /energy trace 时,它显示(除其他外)bds.exe 已请求比默认值 15.6ms 更小的计时器分辨率。
Current Timer Resolution (100ns units) 10006
Maximum Timer Period (100ns units) 156250
Requested Period 10000
Requesting Process ID 7996
Requesting Process Path \Device\HarddiskVolume2\Program Files (x86)\Embarcadero\RAD Studio.0\bin\bds.exe
delphi 是否有充分的理由更改平台计时器分辨率? ide 的最新版本也有相同的行为吗?
IDE 为 ProjectManager、StructureView 和 Log-Window 使用了非常旧的 VirtualTrees.pas 版本。此版本在其 InitializeGlobalStructures
函数中调用 timeBeginPeriod
并将计时器分辨率设置为最小值 (1)。它在单位的 finalization
块中重置。
VirtualTrees 通过此提交更改了此行为:
2013-09-20 21:40:21: No longer changing timer resolution globally (#365)
但是 IDE 仍然使用非常旧的版本,甚至不使用 UnicodeString,而是使用 WideString。所以它自 Delphi 2007 年以来就没有更新过。
我注意到,每当我打开 delphi 2010 ide 时,笔记本电脑的电池寿命就会明显变差。当我 powercfg /energy trace 时,它显示(除其他外)bds.exe 已请求比默认值 15.6ms 更小的计时器分辨率。
Current Timer Resolution (100ns units) 10006
Maximum Timer Period (100ns units) 156250
Requested Period 10000
Requesting Process ID 7996
Requesting Process Path \Device\HarddiskVolume2\Program Files (x86)\Embarcadero\RAD Studio.0\bin\bds.exe
delphi 是否有充分的理由更改平台计时器分辨率? ide 的最新版本也有相同的行为吗?
IDE 为 ProjectManager、StructureView 和 Log-Window 使用了非常旧的 VirtualTrees.pas 版本。此版本在其 InitializeGlobalStructures
函数中调用 timeBeginPeriod
并将计时器分辨率设置为最小值 (1)。它在单位的 finalization
块中重置。
VirtualTrees 通过此提交更改了此行为:
2013-09-20 21:40:21: No longer changing timer resolution globally (#365)
但是 IDE 仍然使用非常旧的版本,甚至不使用 UnicodeString,而是使用 WideString。所以它自 Delphi 2007 年以来就没有更新过。