!4947 【Sample】修改时钟内存回收时间

Merge pull request !4947 from 张宏/clock
This commit is contained in:
openharmony_ci 2024-11-18 12:49:39 +00:00 committed by Gitee
commit 5b452fec87
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -19,7 +19,7 @@ import { forceGC } from '../util/ForceGCUtil';
const HOURS: Array<string> = ['3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '1', '2']
const HEIGHT_ADD: number = 150 // 表盘下面需要绘制时间canvas高度是宽度加150
const TAG: string = 'Index'
const DELAY: number = 600000;
const DELAY: number = 7200000;
const UPDATE_DELAY: number = 1000;
@Entry
@ -214,7 +214,7 @@ struct Clock {
Logger.info(TAG, `onReady`)
this.updateTime()
this.intervalId = setInterval(this.updateTime, 1000)
this.intervalIdGC = setInterval(forceGC, DELAY); // 10分钟GC一次
this.intervalIdGC = setInterval(forceGC, DELAY); // 2小时GC一次
})
}
.width('100%')