当前位置: 首页>>代码示例>>Java>>正文


Java SystemClock.currentThreadTimeMillis方法代码示例

本文整理汇总了Java中android.os.SystemClock.currentThreadTimeMillis方法的典型用法代码示例。如果您正苦于以下问题:Java SystemClock.currentThreadTimeMillis方法的具体用法?Java SystemClock.currentThreadTimeMillis怎么用?Java SystemClock.currentThreadTimeMillis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.SystemClock的用法示例。


在下文中一共展示了SystemClock.currentThreadTimeMillis方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import android.os.SystemClock; //导入方法依赖的package包/类
public void run() {
    Object obj = 1;
    SystemClock.currentThreadTimeMillis();
    this.b = (float) (((double) this.b) + 0.1d);
    float f = this.b;
    if (f > 1.0f) {
        f = 1.0f;
    }
    Object obj2 = f >= 1.0f ? 1 : null;
    int interpolation = (int) (this.c.D.getInterpolation(f) * ((float) this.c.J));
    if (this.a) {
        this.c.d.y = this.c.K + interpolation;
    } else {
        this.c.d.y = this.c.K - interpolation;
    }
    com.tencent.open.a.f.b("TAG", "mWinParams.y = " + this.c.d.y + "deltaDistence = " + interpolation);
    if (this.c.E) {
        this.c.f.updateViewLayout(this.c.e, this.c.d);
        obj = obj2;
    }
    if (obj != null) {
        this.c.i();
    } else {
        this.c.g.postDelayed(this.c.M, 5);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:TaskGuide.java

示例2: onActivityResult

import android.os.SystemClock; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_IMAGE) {
        final ArrayList<String> pathList =
                data.getStringArrayListExtra(PhotoPickerActivity.EXTRA_RESULT_SELECTION);

        long id;
        // TODO: 2017/9/14 可以在线程中添加这段代码防止主线程卡顿
        for (String path :
                pathList) {
            id = SystemClock.currentThreadTimeMillis();
            long size[] = SizeUtil.getBitmapSize(path);
            mRichTextView.insertImage(path, id, size[0], size[1]);
            mInsertedImages.put(id, path);
            tryUpload(path, id);
        }
        //是否是原图
        final boolean original =
                data.getBooleanExtra(PhotoPickerActivity.EXTRA_RESULT_ORIGINAL, false);
    }
}
 
开发者ID:nowandfurure,项目名称:richeditor,代码行数:23,代码来源:MainActivity.java

示例3: doFrame

import android.os.SystemClock; //导入方法依赖的package包/类
@Override
public void doFrame(long frameTimeNanos) {
    if (isExit) {
        return;
    }
    choreographer.postFrameCallback(this);

    long wallClockTimeMs = System.currentTimeMillis() - startWallClockTimeMs;
    long cpuTimeMs = SystemClock.currentThreadTimeMillis() - startCpuTimeMs;
    startWallClockTimeMs = System.currentTimeMillis();
    startCpuTimeMs = SystemClock.currentThreadTimeMillis();

    int a = (int) (wallClockTimeMs / 16);
    if (wallClockTimeMs >= warningFrameMs || config.isBlock(wallClockTimeMs, cpuTimeMs)) {
        Logger.e("Oops!!!! choreographer block!!! " + "msTime:" + wallClockTimeMs + " threadTime:" +
                cpuTimeMs);
        onBlock(wallClockTimeMs, cpuTimeMs);
        Logger.i("zkw", "-------skipped: " + a + " --- wall time:" + wallClockTimeMs);
    }

    //TODO 这里会影响性能,注意优化
    SamplerFactory.getMethodSampler().cleanRootMethodList();
}
 
开发者ID:zkwlx,项目名称:DroidTelescope,代码行数:24,代码来源:ChoreographerMonitor.java

示例4: println

import android.os.SystemClock; //导入方法依赖的package包/类
@Override
public void println(String x) {
    if (isStart) {
        //                Log.i("zkw", "----------------loop start-----------------");
        isStart = false;
        startWallClockTimeMs = System.currentTimeMillis();
        startCpuTimeMs = SystemClock.currentThreadTimeMillis();
    } else {
        //                Log.i("zkw", "----------------loop end-----------------");
        isStart = true;
        long wallClockTimeMs = System.currentTimeMillis() - startWallClockTimeMs;
        long cpuTimeMs = SystemClock.currentThreadTimeMillis() - startCpuTimeMs;

        if (wallClockTimeMs >= warningFrameMs || config.isBlock(wallClockTimeMs, cpuTimeMs)) {
            Logger.e(TAG,
                    "Oops!!!!loop block!!! " + "msTime:" + wallClockTimeMs + " threadTime:" + cpuTimeMs);
            onBlock(wallClockTimeMs, cpuTimeMs);
        }

        //TODO 这里会影响性能,注意优化
        SamplerFactory.getMethodSampler().cleanRootMethodList();
    }
}
 
开发者ID:zkwlx,项目名称:DroidTelescope,代码行数:24,代码来源:LooperMonitor.java

示例5: resizeUrl

import android.os.SystemClock; //导入方法依赖的package包/类
public String resizeUrl(ImageView img, String url) {
    if (TextUtils.isEmpty(url)) {
        return "null"+SystemClock.currentThreadTimeMillis();
    }
    String type = "large";
    if (img.getLayoutParams() != null) {
        int width = img.getLayoutParams().width;
        int height = img.getLayoutParams().height;
        if (width < 400 && height < 400) {
            type = "thumb";
        } else if (width < 800 && height < 800) {
            type = "small";
        }
    }

    return url + "_" + type;
}
 
开发者ID:qsyj,项目名称:ShortcutMenu,代码行数:18,代码来源:BitmapUtils.java

示例6: buildNewBitmap

import android.os.SystemClock; //导入方法依赖的package包/类
public Bitmap buildNewBitmap() {
    long start = SystemClock.elapsedRealtime();
    long startThread = SystemClock.currentThreadTimeMillis();

    Bitmap bitmap=null;
    // catch all exception because we REALLY don't want to crash the whole application in case there is any issue with this cosmetic feature
    try {
        bitmap = buildIconBitmap(mContext.getContentResolver());
    } catch (Exception ex) {
        Log.e(TAG, "buildIconBitmap exception ", ex);
    }

    long endThread = SystemClock.currentThreadTimeMillis();
    long end = SystemClock.elapsedRealtime();
    Log.d(TAG, "buildNewBitmap took "+(endThread-startThread)+" | "+(end-start));
    return bitmap;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:18,代码来源:AllMoviesIconBuilder.java

示例7: a

import android.os.SystemClock; //导入方法依赖的package包/类
private void a(boolean z) {
    this.I = SystemClock.currentThreadTimeMillis();
    if (z) {
        this.G = true;
    } else {
        this.H = true;
    }
    this.J = this.d.height;
    this.K = this.d.y;
    LayoutParams layoutParams = this.d;
    layoutParams.flags |= 16;
    this.f.updateViewLayout(this.e, this.d);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:TaskGuide.java

示例8: start

import android.os.SystemClock; //导入方法依赖的package包/类
public void start(String name) {
    if (started) {
        throw new RuntimeException("Already started");
    }
    started = true;
    prepareForNextRun();
    if (values.isEmpty()) {
        values.addAll(fixedColumns);
        String startTime = dateFormat.format(new Date());
        values.add(new Pair<>("time", startTime));
    }
    this.name = name;
    threadTimeMillis = SystemClock.currentThreadTimeMillis();
    timeMillis = SystemClock.elapsedRealtime();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:Benchmark.java

示例9: stop

import android.os.SystemClock; //导入方法依赖的package包/类
public void stop() {
    long time = SystemClock.elapsedRealtime() - timeMillis;
    long timeThread = SystemClock.currentThreadTimeMillis() - threadTimeMillis;
    if (!started) {
        throw new RuntimeException("Not started");
    }
    started = false;

    Log.d(TAG, name + ": " + time + " ms (thread: " + timeThread + " ms)");
    values.add(new Pair<>(name, Long.toString(time)));
    if (storeThreadTime) {
        values.add(new Pair<>(name + "-thread", Long.toString(timeThread)));
    }
    name = null;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:Benchmark.java

示例10: endSplit

import android.os.SystemClock; //导入方法依赖的package包/类
public void endSplit(final String splitName) {
  final long currWallTime = SystemClock.uptimeMillis();
  final long currCpuTime = SystemClock.currentThreadTimeMillis();

  logger.i(
      "%s: cpu=%dms wall=%dms",
      splitName, currCpuTime - lastCpuTime, currWallTime - lastWallTime);

  lastWallTime = currWallTime;
  lastCpuTime = currCpuTime;
}
 
开发者ID:Jamjomjara,项目名称:snu-artoon,代码行数:12,代码来源:SplitTimer.java

示例11: onCreate

import android.os.SystemClock; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash_manager);
    et_activie  =(EditText)findViewById(R.id.et_active);
    findViewById(R.id.btn_active).setOnClickListener(this);
    String code=readCode();
    long timestamp=readCodeTimeStamp();
    if(!TextUtils.isEmpty(code)){
        if(SystemClock.currentThreadTimeMillis()<timestamp)
            startActivityForResult(new Intent(SplashManager.this,MainActivity.class),0);
        else
            Toast.makeText(getApplicationContext(),"激活码已过期",Toast.LENGTH_SHORT).show();
    }
}
 
开发者ID:IronMan001,项目名称:ss-android,代码行数:16,代码来源:SplashManager.java

示例12: Spot

import android.os.SystemClock; //导入方法依赖的package包/类
public Spot() {
	this(0, 0, 0, 0, SystemClock.currentThreadTimeMillis(), MotionEvent.TOOL_TYPE_FINGER);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:4,代码来源:Spot.java

示例13: now

import android.os.SystemClock; //导入方法依赖的package包/类
long now() {
  return SystemClock.currentThreadTimeMillis();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:BitmapPreFillRunner.java

示例14: newSplit

import android.os.SystemClock; //导入方法依赖的package包/类
public void newSplit() {
  lastWallTime = SystemClock.uptimeMillis();
  lastCpuTime = SystemClock.currentThreadTimeMillis();
}
 
开发者ID:Jamjomjara,项目名称:snu-artoon,代码行数:5,代码来源:SplitTimer.java

示例15: methodExit

import android.os.SystemClock; //导入方法依赖的package包/类
public static void methodExit(long startTimeNano, long startThreadTime, String cls, String method,
        String argTypes) {
    long wallClockTimeNs = System.nanoTime() - startTimeNano;
    long cpuTimeMs = SystemClock.currentThreadTimeMillis() - startThreadTime;
    SamplerFactory.getMethodSampler().onMethodExit(wallClockTimeNs, cpuTimeMs, cls, method, argTypes);
}
 
开发者ID:zkwlx,项目名称:DroidTelescope,代码行数:7,代码来源:TimeConsumingSample.java


注:本文中的android.os.SystemClock.currentThreadTimeMillis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。