1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.workbench.internal;
\r
14 import org.eclipse.core.runtime.NullProgressMonitor;
\r
17 * @author Tuukka Lehtonen
\r
19 class TimingProgressMonitor extends NullProgressMonitor {
\r
21 private final long start;
\r
23 public TimingProgressMonitor() {
\r
24 this.start = System.nanoTime();
\r
28 public void worked(int work) {
\r
29 System.out.println("worked(" + work + ") @ " + (System.nanoTime() - start)*1e-9);
\r
33 public void subTask(String name) {
\r
34 System.out.println("subTask(" + name + ") @ " + (System.nanoTime() - start)*1e-9);
\r
38 public void setTaskName(String name) {
\r
39 System.out.println("setTaskName(" + name + ") @ " + (System.nanoTime() - start)*1e-9);
\r
43 public void setCanceled(boolean value) {
\r
44 System.out.println("setCanceled(" + value+ ") @ " + (System.nanoTime() - start)*1e-9);
\r
45 super.setCanceled(value);
\r
49 public boolean isCanceled() {
\r
50 System.out.println("isCanceled() @ " + (System.nanoTime() - start)*1e-9);
\r
51 return super.isCanceled();
\r
55 public void internalWorked(double work) {
\r
56 System.out.println("internalWorked(" + work + ") @ " + (System.nanoTime() - start)*1e-9);
\r
60 public void done() {
\r
61 System.out.println("done() @ " + (System.nanoTime() - start)*1e-9);
\r
65 public void beginTask(String name, int totalWork) {
\r
66 System.out.println("beginTask(" + name + ", " + totalWork + ") @ " + (System.nanoTime() - start)*1e-9);
\r