01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.ui;
17:
18: /**
19: * TODO: document me.
20: */
21: public class ListBoxProfile extends WidgetProfile {
22:
23: public void testTiming() throws Exception {
24: testTiming(1);
25: testTiming(2);
26: testTiming(4);
27: testTiming(8);
28: testTiming(16);
29: testTiming(32);
30: testTiming(64);
31: testTiming(128);
32: testTiming(256);
33: testTiming(512);
34: testTiming(1024);
35:
36: throw new Exception("Finished profiling");
37: }
38:
39: public void testTiming(int i) {
40: addTiming(i);
41: }
42:
43: public void addTiming(int num) {
44: ListBox b = new ListBox();
45: RootPanel.get().add(b);
46: resetTimer();
47: for (int i = 0; i < num; i++) {
48: b.addItem("item" + i, "i:" + i);
49: }
50: timing("add(" + num + ")");
51: }
52: }
|