本文整理汇总了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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
}
示例12: Spot
import android.os.SystemClock; //导入方法依赖的package包/类
public Spot() {
this(0, 0, 0, 0, SystemClock.currentThreadTimeMillis(), MotionEvent.TOOL_TYPE_FINGER);
}
示例13: now
import android.os.SystemClock; //导入方法依赖的package包/类
long now() {
return SystemClock.currentThreadTimeMillis();
}
示例14: newSplit
import android.os.SystemClock; //导入方法依赖的package包/类
public void newSplit() {
lastWallTime = SystemClock.uptimeMillis();
lastCpuTime = SystemClock.currentThreadTimeMillis();
}
示例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);
}