All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.openhtmltopdf.test.HamletSpeedTest Maven / Gradle / Ivy

package com.openhtmltopdf.test;

import com.openhtmltopdf.simple.Graphics2DRenderer;
import com.openhtmltopdf.util.Uu;

import java.io.File;
import java.util.Date;

public class HamletSpeedTest {

    public static void main(String[] args) throws Exception {
        long total = 0;
        for (int i = 0; i < 10; i++) {
            Date start = new Date();
            Graphics2DRenderer.renderToImage(
                    new File("demos/browser/xhtml/old/hamlet.xhtml").toURL().toExternalForm(),
                    700, 700);
            Date end = new Date();
            long diff = (end.getTime() - start.getTime());
            Uu.p("ms = " + diff);
            total += diff;
        }
        long avg = total / 10;
        Uu.p("average : " + avg);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy