/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ package graphical; import java.io.File; // import java.io.FileWriter; // import java.io.OutputStream; // import java.io.PrintStream; import java.io.PrintStream; import java.io.RandomAccessFile; // import java.io.StringWriter; // import java.lang.Double; public class PerformanceContainer /* extends *//* implements */ { private long m_nStartTime; /* simple helper functions to start/stop a timer, to know how long a process need in milliseconds */ public long getStartTime() { return System.currentTimeMillis(); } public void setStartTime(long _nStartTime) { m_nStartTime = _nStartTime; } /* return the time, which is done until last startTime() */ private long meanTime(long _nCurrentTimer) { if (_nCurrentTimer == 0) { GlobalLogWriter.println("Forgotten to initialise a start timer."); return 0; } long nMeanTime = System.currentTimeMillis(); return nMeanTime - _nCurrentTimer; } /* public long stopTimer() { if (m_nStartTime == 0) { System.out.println("Forgotten to initialise start timer."); return 0; } long nStopTime = System.currentTimeMillis(); return nStopTime - m_nStartTime; } */ final static int Load = 0; final static int Store = 1; final static int Print = 2; final static int OfficeStart = 3; final static int StoreAsPDF = 4; final static int OfficeStop = 5; final static int AllTime = 6; final static int LAST_VALUE = 7; // THIS MUST BE ALWAYS THE LAST AND THE BIGGEST VALUE! private long m_nTime[]; private String m_sMSOfficeVersion; public PerformanceContainer() { m_nTime = new long[LAST_VALUE]; // @todo: is this need? for (int i=0;i