提交 07f89352 authored 作者: Thomas Mueller's avatar Thomas Mueller

Simplify usage.

上级 b0ed2038
...@@ -232,17 +232,22 @@ public class Profiler implements Runnable { ...@@ -232,17 +232,22 @@ public class Profiler implements Runnable {
/** /**
* Start collecting profiling data. * Start collecting profiling data.
*
* @return this
*/ */
public void startCollecting() { public Profiler startCollecting() {
thread = new Thread(this, "Profiler"); thread = new Thread(this, "Profiler");
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
return this;
} }
/** /**
* Stop collecting. * Stop collecting.
*
* @return this
*/ */
public void stopCollecting() { public Profiler stopCollecting() {
stop = true; stop = true;
if (thread != null) { if (thread != null) {
try { try {
...@@ -252,6 +257,7 @@ public class Profiler implements Runnable { ...@@ -252,6 +257,7 @@ public class Profiler implements Runnable {
} }
thread = null; thread = null;
} }
return this;
} }
public void run() { public void run() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论