提交 e7b59df2 编写于 作者: Z z00445003

solve ActsAmsNewWantTest fail problem

Signed-off-by: Nz00445003 <zhoujun62@huawei.com>
Change-Id: Idadc80a97ea13b4e316ef9f5c273d043766764dd
上级 181bff54
...@@ -16,8 +16,13 @@ ...@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) { function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, ms)); let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
} }
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -16,8 +16,13 @@ ...@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) { function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, ms)); let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
} }
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -16,8 +16,13 @@ ...@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) { function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, ms)); let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
} }
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -16,8 +16,13 @@ ...@@ -16,8 +16,13 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) { function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, ms)); let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
} }
export default class SecondAbility extends Ability { export default class SecondAbility extends Ability {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册