APISonar


org.apache.jena.atlas.lib.Timer.time

> org > apache > jena > atlas > lib > Timer > time
org APIs apache APIs jena APIs atlas APIs lib APIs Timer APIs time APIs

Example 1
private static long acquire(Semaphore semaphore, int numPermits) {
        return Timer.time(()->{
            try { semaphore.acquire(numPermits); }
            catch (InterruptedException e) {
                Log.error(Indexer.class, "Interrupted", e);
                throw new RuntimeException(e);
            }
        });
    }
Example 2
private long execBulkLoad(DatasetGraph dsg, String graphName, List<String> urls, boolean showProgress) {
        DataLoader loader = chooseLoader(dsg, graphName);
        long elapsed = Timer.time(()->{
                    loader.startBulk();
                    loader.load(urls);
                    loader.finishBulk();
        });
        return elapsed;
    }