use of com.scythe.instrumenter.analysis.task.AbstractTask in project kanonizo by kanonizo.
the class AbstractSearchAlgorithm method start.
@Override
public void start() {
startTime = System.currentTimeMillis();
Task timerTask = new AbstractTask() {
@Override
public String asString() {
return "Running " + getClass().getSimpleName();
}
};
if (InstrumentationProperties.LOG) {
TaskTimer.taskStart(timerTask);
}
fw.getDisplay().notifyTaskStart("Running Test Prioritisation", false);
generateSolution();
TaskTimer.taskEnd(timerTask);
BufferedOutputStream stream = null;
try {
File file = new File(InstrumentationProperties.LOG_DIR + "/algorithm_time.dat");
File logdir = new File(InstrumentationProperties.LOG_DIR);
if (!logdir.exists()) {
logdir.mkdirs();
}
if (!file.exists()) {
file.createNewFile();
}
stream = new BufferedOutputStream(new FileOutputStream(file));
stream.write(String.valueOf(System.currentTimeMillis() - startTime).getBytes());
} catch (final IOException e) {
e.printStackTrace();
} finally {
totalTime = System.currentTimeMillis() - startTime;
if (stream != null) {
try {
stream.close();
} catch (final IOException e) {
e.printStackTrace();
}
}
}
}
Aggregations