Skip to content

Commit 9fab963

Browse files
author
blagoev
committed
Do get PID only when logging needed
1 parent 3643c67 commit 9fab963

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/src/com/tns/Platform.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,14 @@ public static int init(Context context) throws RuntimeException
116116
int debuggerPort = jsDebugger.getDebuggerPortFromEnvironment();
117117

118118
//
119-
Date d = new Date();
120-
int pid = android.os.Process.myPid();
121-
File f = new File("/proc/" + pid);
122-
Date lastModDate = new Date(f.lastModified());
123-
if (IsLogEnabled) Log.d(DEFAULT_LOG_TAG, "init time=" + (d.getTime() - lastModDate.getTime()));
119+
if (IsLogEnabled)
120+
{
121+
Date d = new Date();
122+
int pid = android.os.Process.myPid();
123+
File f = new File("/proc/" + pid);
124+
Date lastModDate = new Date(f.lastModified());
125+
Log.d(DEFAULT_LOG_TAG, "init time=" + (d.getTime() - lastModDate.getTime()));
126+
}
124127
//
125128

126129
return appJavaObjectId;

0 commit comments

Comments
 (0)