Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d75ae5e4
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d75ae5e4
编写于
8月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4925 add perf cases
Merge pull request !4925 from 杨清/1228
上级
ef9a501a
a48e7b6e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
160 addition
and
0 deletion
+160
-0
global/perf/perfjs/src/main/js/test/Perf.test.js
global/perf/perfjs/src/main/js/test/Perf.test.js
+160
-0
未找到文件。
global/perf/perfjs/src/main/js/test/Perf.test.js
浏览文件 @
d75ae5e4
...
...
@@ -2196,5 +2196,165 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9000
* @tc.name test the performance of getLocationName
* @tc.desc check the performance of getLocationName
*/
it
(
'
perf_test_9000
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9000
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
perf_test_9000
'
+
ran
);
let
value
=
'
test
'
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
phonenumber
.
getLocationName
(
'
1351057467
'
+
ran
,
'
zh-CN
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9000--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
expect
(
value
).
assertEqual
(
'
广东省深圳市
'
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9100
* @tc.name test the performance of getUsingLocalDigit
* @tc.desc check the performance of getUsingLocalDigit
*/
it
(
'
perf_test_9100
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9100
'
+
'
start
'
);
let
value
=
true
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
getUsingLocalDigit
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9100--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9200
* @tc.name test the performance of timezone.getAvailableIDs
* @tc.desc check the performance of timezone.getAvailableIDs
*/
it
(
'
perf_test_9200
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9200
'
+
'
start
'
);
let
value
=
'
test
'
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
TimeZone
.
getAvailableIDs
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9200--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9300
* @tc.name test the performance of getAvailableZoneCityIDs
* @tc.desc check the performance of getAvailableZoneCityIDs
*/
it
(
'
perf_test_9300
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9300
'
+
'
start
'
);
let
value
=
'
test
'
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
TimeZone
.
getAvailableZoneCityIDs
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9300--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9400
* @tc.name test the performance of getCityDisplayName
* @tc.desc check the performance of getCityDisplayName
*/
it
(
'
perf_test_9400
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9400
'
+
'
start
'
);
let
value
=
'
test
'
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
TimeZone
.
getCityDisplayName
(
'
Auckland
'
,
'
zh
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9400--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9500
* @tc.name test the performance of getTimezoneFromCity
* @tc.desc check the performance of getTimezoneFromCity
*/
it
(
'
perf_test_9500
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9500
'
+
'
start
'
);
let
value
=
'
test
'
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
TimeZone
.
getTimezoneFromCity
(
'
Auckland
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9500--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
console
.
log
(
'
*************end PerfTest*************
'
);
})}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录