Example usage for org.apache.wicket.util IProvider get

List of usage examples for org.apache.wicket.util IProvider get

Introduction

In this page you can find the example usage for org.apache.wicket.util IProvider get.

Prototype

T get();

Source Link

Document

Provides an instance of type T

Usage

From source file:org.wicketstuff.lazymodel.PropertyModelComparison.java

License:Apache License

private Duration measureTime(IProvider<IModel<?>> provider) {
    Time start = Time.now();

    for (int i = 0; i < 100000; i++) {
        final IModel<?> m = provider.get();
        for (int j = 0; j < 10; j++) {
            m.getObject();/* w w w.j av  a2 s.  c  o  m*/
        }
    }

    Duration duration = Time.now().subtract(start);

    System.out.println(String.format("PropertyModelComparison %s: %s seconds", provider.get().getClass(),
            duration.seconds()));

    return duration;
}