當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。