简体   繁体   English

Dart/Flutter 中 TimingLogger 的等价物是什么?

[英]What is the equivalent of TimingLogger in Dart/Flutter?

        val timings = TimingLogger("FEED_PROFILE", "reading bitmap frame")
        val bitmap = BitmapFactory.decodeByteArray(imageData, 0, imageData.size);
        timings.addSplit("converting bytes to bitmap done")
        val bmOverlay = Bitmap.createBitmap(bitmap.width, bitmap.height, bitmap.config)
        timings.addSplit("reading bitmap done")
        timings.dumpToLog()

The above prints以上印

D/FEED_PROFILE( 5019): reading bitmap frame: begin
D/FEED_PROFILE( 5019): reading bitmap frame:      244 ms, converting bytes to bitmap done
D/FEED_PROFILE( 5019): reading bitmap frame:      0 ms, reading bitmap done
D/FEED_PROFILE( 5019): reading bitmap frame: end, 244 ms

But this is Kotlin/Java code.但这是 Kotlin/Java 代码。 What does Flutter/Dart have to achieve similar result ? Flutter/Dart 需要什么才能达到类似的结果?

Currently, I am using目前,我正在使用

 final start = DateTime.now().millisecondsSinceEpoch;
 // something
 final lapse = DateTime.now().millisecondsSinceEpoch - start;
 print('$logId Screenshoot took $lapse ms ${pngBytes.length}');

But this gets complicates when I try to replicate the addSplit .但是当我尝试复制addSplit时,这会变得复杂。 Hence I am looking for something built-in in either Dart or Flutter因此,我正在寻找 Dart 或 Flutter 中内置的东西

我在等待答案时做了一个插件https://pub.dev/packages/timing_logger

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 何时使用 Dart/Flutter Isolate? - When to use Dart/Flutter Isolate? 什么是Oracle中的堆转储的等价物 - What is the equivalent of a heap dump in Oracle Flutter/Dart 如何调整 Modalbottomsheet animation 速度? - Flutter/Dart How to adjust Modalbottomsheet animation speed? Dart:在不打开 Flutter App 的情况下从 Flutter-Canvas 获取字节 - Dart: Get bytes from Flutter-Canvas without opening Flutter App 减少/拆分 Flutter 生成的 Web 输出文件“main.dart.js”的大小? - Reduce/split size of Flutter generated web-output file "main.dart.js"? W3 Total Cache Wordpress插件的等效Drupal 7模块是什么? - What is the equivalent Drupal 7 module for the W3 Total Cache Wordpress plugin? 什么是Java中的“公共静态最终”常量的Clojure等价物 - What is the Clojure equivalent of a “public static final” constant in Java InnoDB相当于MyISAM的key_buffer_size是什么? - What is the InnoDB equivalent of MyISAM's key_buffer_size? Postgresql与Oracle中的dbms_stats.gather_table_stats等效什么? - what is equivalent of Postgresql to dbms_stats.gather_table_stats in Oracle? 什么是java的等效于java的-verbose:gc命令行选项 - What is the .NET equivalent of java's -verbose:gc command line option
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM