Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
d31c999e
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
大约 1 年 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d31c999e
编写于
4月 13, 2020
作者:
Y
yixiangboy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
app launch add time profiler
上级
5ea66e79
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
74 addition
and
0 deletion
+74
-0
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/DoraemonStartTimeViewController.m
...n/Performance/StartTime/DoraemonStartTimeViewController.m
+3
-0
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/TimeProfiler/DoraemonStartTimeProfilerViewController.h
...me/TimeProfiler/DoraemonStartTimeProfilerViewController.h
+16
-0
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/TimeProfiler/DoraemonStartTimeProfilerViewController.m
...me/TimeProfiler/DoraemonStartTimeProfilerViewController.m
+55
-0
未找到文件。
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/DoraemonStartTimeViewController.m
浏览文件 @
d31c999e
...
...
@@ -15,6 +15,7 @@
#import <objc/runtime.h>
#import "DoraemonHealthManager.h"
#import "DoraemonTimeProfiler.h"
#import "DoraemonStartTimeProfilerViewController.h"
static
NSTimeInterval
startTime
;
static
NSTimeInterval
endTime
;
...
...
@@ -92,6 +93,8 @@ static NSTimeInterval endTime;
#pragma mark -- DoraemonCellButtonDelegate
-
(
void
)
cellBtnClick
:(
id
)
sender
{
DoraemonStartTimeProfilerViewController
*
vc
=
[[
DoraemonStartTimeProfilerViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
YES
];
}
...
...
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/TimeProfiler/DoraemonStartTimeProfilerViewController.h
0 → 100644
浏览文件 @
d31c999e
//
// DoraemonStartTimeProfilerViewController.h
// DoraemonKit-DoraemonKit
//
// Created by didi on 2020/4/13.
//
#import "DoraemonBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonStartTimeProfilerViewController
:
DoraemonBaseViewController
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Plugin/Performance/StartTime/TimeProfiler/DoraemonStartTimeProfilerViewController.m
0 → 100644
浏览文件 @
d31c999e
//
// DoraemonStartTimeProfilerViewController.m
// DoraemonKit-DoraemonKit
//
// Created by didi on 2020/4/13.
//
#import "DoraemonStartTimeProfilerViewController.h"
#import "DoraemonDefine.h"
#import "DoraemonHealthManager.h"
@interface
DoraemonStartTimeProfilerViewController
()
@property
(
nonatomic
,
strong
)
UITextView
*
contentLabel
;
@end
@implementation
DoraemonStartTimeProfilerViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
DoraemonLocalizedString
(
@"启动耗时"
);
[
self
setRightNavTitle
:
DoraemonLocalizedString
(
@"导出"
)];
NSString
*
costDetail
=
[
DoraemonHealthManager
sharedInstance
].
costDetail
;
_contentLabel
=
[[
UITextView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
_contentLabel
.
textColor
=
[
UIColor
doraemon_black_2
];
_contentLabel
.
font
=
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750_Landscape
(
16
)];
_contentLabel
.
text
=
costDetail
;
[
self
.
view
addSubview
:
_contentLabel
];
}
-
(
void
)
rightNavTitleClick
:(
id
)
clickView
{
[
self
export
:
_contentLabel
.
text
];
}
-
(
void
)
export
:(
NSString
*
)
text
{
NSString
*
cachesDir
=
[
NSSearchPathForDirectoriesInDomains
(
NSCachesDirectory
,
NSUserDomainMask
,
YES
)
firstObject
];
NSString
*
tempDir
=
[
cachesDir
stringByAppendingPathComponent
:
@"DoKitTemp"
];
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
BOOL
isDir
=
NO
;
BOOL
existed
=
[
fileManager
fileExistsAtPath
:
tempDir
isDirectory
:
&
isDir
];
if
(
!
(
isDir
&&
existed
)){
[
fileManager
createDirectoryAtPath
:
tempDir
withIntermediateDirectories
:
YES
attributes
:
nil
error
:
nil
];
}
NSString
*
path
=
[
tempDir
stringByAppendingPathComponent
:
@"startCostDetail.txt"
];
BOOL
writeSuccess
=
[
text
writeToFile
:
path
atomically
:
YES
encoding
:
NSUTF8StringEncoding
error
:
nil
];
if
(
writeSuccess
)
{
[
DoraemonUtil
shareFileWithPath
:
path
formVC
:
self
];
}
}
@end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录