---
title: "一些标准操作所需的时间量"
author: "zcbbupt"
date: "2011-01-10T21:52:43Z"
tags: ["Android", "XML"]
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2011-01-10T21:52:43Z"
id: 867627
url: "https://zcbbupt.iteye.com/blog/867627"
---

android应用中一些基本操作所需的时间量如下：

|操作                          |时间（ms）
|添加一个局部变量              |1
|添加一个成员变量              |4
|调用String.length()           |5
|调用一个空的原生态方法             |5
|调用一个空的静态方法              |12
|调用一个空的虚方法              |12.5
|调用一个空的接口方法             |15
|调用HashMap中的Iterator.next()方法              |165
|调用hashMap中的put()方法              |600
|从Xml文件中读取一个View              |22000
|读取一个Linearlayout中包含1个TextView对象              |25000
|读取一个Linearlayout中包含6个View对象             |100000
|读取一个Linearlayout中包含6个TextView对象  |135000
|启动一个Activity                   |3000000