Skip to content

AsherYang/AsherDebug

Repository files navigation

An android performance test library

提供android 测试方法执行时间的库

参考仿照JakeWharton/hugo 库,主要是学习如何在android中使用Aspectj进行AOP切面编程

说明

AsherDebug 是一款基于AOP的性能检测库。

主要包含一下功能:

  1. 提供函数运行时间检测

使用方法

  1. 在宿主build.gradle中添加依赖支持
 buildscript {
     repositories {
         mavenCentral()
         maven { url "http://172.28.10.222:8081/nexus/content/groups/android_public/" }
     }
     dependencies {
         classpath 'com.xtc.ouyangfan.aop:aop-time-plugin:0.0.7-SNAPSHOT'
     }
 }
 
 apply plugin: 'asher'
  1. 使用@Time来进行检测时间
@Time
private void testTime(String name, int age) {
   try {
       Thread.sleep(5000);
       Log.i(TAG, "--- name = " + name + " , age = " + age);
   } catch (InterruptedException e) {
       e.printStackTrace();
   }
} 

程序运行

pic01

Releases

No releases published

Packages

No packages published