未验证 提交 24109d9b 编写于 作者: O openharmony_ci 提交者: Gitee

!5550 solve ActsAmsNewWantTest fail problem

Merge pull request !5550 from zhoujun62/my_xts_acts
......@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
......
......@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
......
......@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
......
......@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class SecondAbility extends Ability {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册