Commit 54a62357 authored by dsq's avatar dsq

用于临时测试-不合入master1

parent 3a1a03d9
...@@ -31,30 +31,24 @@ internal fun Compose1500Text() { ...@@ -31,30 +31,24 @@ internal fun Compose1500Text() {
val platformTag = perfPlatformTag() val platformTag = perfPlatformTag()
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
// val enterTs = PerfLogger.get("scene_1500text_enter_click_ts") ?: nowMs()
//这里发送进入
os_signal_set("进入页面")
// 至少等到一帧真正调度后再记「首帧」,避免与点击同一时刻的伪首帧 // 至少等到一帧真正调度后再记「首帧」,避免与点击同一时刻的伪首帧
withFrameMillis { } withFrameMillis {
os_signal_set("响应时间-上帧(结束)","respose_time",false)
}
//这里发送首帧
os_signal_set("进入首帧")
// 等布局给出可滚动高度后再滚到底,再等一帧记「完成」 // 等布局给出可滚动高度后再滚到底,再等一帧记「完成」
while (scrollState.maxValue == 0) { while (scrollState.maxValue == 0) {
os_signal_set("一帧完成")
withFrameMillis { } withFrameMillis { }
} }
//这里发送开始滚动 //这里发送开始滚动
os_signal_set("开始滚动") os_signal_set("滚动(开始)","1500_scroll",true)
scrollState.scrollTo(scrollState.maxValue) scrollState.scrollTo(scrollState.maxValue)
withFrameMillis { } withFrameMillis { }
os_signal_set("滚动(结束)","1500_scroll",false)
//这里发送结束滚动
os_signal_set("结束滚动")
} }
Column( Column(
......
...@@ -76,7 +76,8 @@ internal fun HomeScreen( ...@@ -76,7 +76,8 @@ internal fun HomeScreen(
) { ) {
Button( Button(
onClick = { onClick = {
os_signal_set("离开首页") os_signal_set("响应时延-从点击(开始)","respose_time",true)
os_signal_set("完成时延-从点击(开始)","finish_time",true)
val debugDataDemo = ComponentDemo( val debugDataDemo = ComponentDemo(
id = "to_1500", id = "to_1500",
title = "进入1500Text测试页面", title = "进入1500Text测试页面",
...@@ -86,7 +87,7 @@ internal fun HomeScreen( ...@@ -86,7 +87,7 @@ internal fun HomeScreen(
}, },
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
Text("进入1500Text")
} }
} }
} }
......
...@@ -17,5 +17,5 @@ expect fun testArkTsToKotin(); ...@@ -17,5 +17,5 @@ expect fun testArkTsToKotin();
expect fun triggerANRByInfiniteLoop(); expect fun triggerANRByInfiniteLoop();
expect fun os_signal_set(type: String) expect fun os_signal_set(type: String,signalId: String,isBegin: Boolean)
package com.dong.demo013 package com.dong.demo013
import platform.Foundation.NSDictionary
import platform.Foundation.NSMusicDirectory
import platform.Foundation.NSMutableDictionary
import platform.Foundation.NSNotificationCenter import platform.Foundation.NSNotificationCenter
import platform.Foundation.NSNumber
import platform.Foundation.NSString
import platform.Foundation.numberWithBool
import platform.Foundation.setValue
actual fun pirntAllLevelHiLog() { actual fun pirntAllLevelHiLog() {
...@@ -19,9 +26,11 @@ actual fun triggerANRByInfiniteLoop() { ...@@ -19,9 +26,11 @@ actual fun triggerANRByInfiniteLoop() {
} }
actual fun os_signal_set(type: String) { actual fun os_signal_set(type: String, signalId: String, isBegin: Boolean) {
val notificationName = "set_os_signal" val notificationName = "set_os_signal"
val userInfo = null val userInfo = NSMutableDictionary()
NSNotificationCenter.defaultCenter().postNotificationName(notificationName,type) userInfo.setValue(type, forKey = "text")
userInfo.setValue(signalId, forKey = "id")
userInfo.setValue(NSNumber.numberWithBool(isBegin), forKey = "isBegin")
NSNotificationCenter.defaultCenter().postNotificationName(notificationName, userInfo)
} }
\ No newline at end of file
import ComposeApp import ComposeApp
import SwiftUI import SwiftUI
import os
@main @main
struct iOSApp: App { struct iOSApp: App {
...@@ -14,8 +15,13 @@ struct iOSApp: App { ...@@ -14,8 +15,13 @@ struct iOSApp: App {
object: nil, object: nil,
queue: .main queue: .main
) { note in ) { note in
if let text = note.object as? String { if let dic = note.object as? NSDictionary{
let text = dic.object(forKey: "text") as! NSString;
print("set_os_signal: \(text)") print("set_os_signal: \(text)")
let isBeginNumber = dic.object(forKey: "isBegin") as! NSNumber;
print("set_os_signal: \(isBeginNumber.boolValue)")
let signalId = dic.object(forKey: "id") as! NSString;
print("set_os_signal: \(signalId)")
} }
} }
...@@ -25,4 +31,6 @@ struct iOSApp: App { ...@@ -25,4 +31,6 @@ struct iOSApp: App {
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment