StartupTimeActivity.java revision 25df6673f1c51e755dd4d08cf64666cdff5e0f18
1// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package org.chromium.webview_shell;
6
7import android.app.Activity;
8import android.os.Bundle;
9import android.os.SystemClock;
10import android.webkit.WebView;
11
12/**
13 * This activity is designed for startup time testing of the WebView.
14 */
15public class StartupTimeActivity extends Activity {
16
17    @Override
18    public void onCreate(Bundle savedInstanceState) {
19        super.onCreate(savedInstanceState);
20        getWindow().setTitle(
21                getResources().getString(R.string.title_activity_startup_time));
22
23        long t1 = SystemClock.elapsedRealtime();
24        WebView webView = new WebView(this);
25        setContentView(webView);
26        long t2 = SystemClock.elapsedRealtime();
27        android.util.Log.i("WebViewShell", "WebViewStartupTimeMillis=" + (t2 - t1));
28    }
29
30}
31
32