* 更新命中率
()
| 265 | * 更新命中率 |
| 266 | */ |
| 267 | private _updateHitRate(): void { |
| 268 | if (this._stats.totalObtained === 0) { |
| 269 | this._stats.hitRate = 0; |
| 270 | } else { |
| 271 | const hits = this._stats.totalObtained - this._stats.totalCreated; |
| 272 | this._stats.hitRate = hits / this._stats.totalObtained; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * 更新内存使用估算 |