Examples of StopWatch


Examples of xbird.util.datetime.StopWatch

                out.writeBoolean(true);
                RemoteSequence remote = (RemoteSequence) result;
                remote.writeExternal(out);
            } else {
                out.writeBoolean(false);
                final StopWatch sw = new StopWatch("Elapsed time for encoding `$" + getName()
                        + '\'');
                final XQEventEncoder encoder = new XQEventEncoder(out);
                try {
                    encoder.emit(result);
                } catch (XQueryException xqe) {
View Full Code Here

Examples of xbird.util.datetime.StopWatch

        if(hasResult) {
            final boolean isRemoteSeq = in.readBoolean();
            if(isRemoteSeq) {
                this._result = RemoteSequence.readFrom(in);
            } else {
                final StopWatch sw = new StopWatch("Elapsed time for decoding `$" + getName()
                        + '\'');
                final XQEventDecoder decoder = new XQEventDecoder(in);
                try {
                    this._result = decoder.decode();
                } catch (XQueryException xqe) {
View Full Code Here

Examples of xbird.util.datetime.StopWatch

    public void testIntLruMap() {
        StringBuilder buf = new StringBuilder(1024);
        System.gc();
        long free = SystemUtils.getHeapFreeMemory();
        buf.append(" free(init): " + free);
        StopWatch sw = new StopWatch("testIntLruMap");
        IntLRUMap<Integer> lru = new IntLRUMap<Integer>(LIMIT);
        for(int i = 0; i < LOOP; i++) {
            lru.put(i, i);
        }
        Random random = new Random();
        for(int i = 0; i < LOOP / 2; i++) {
            int r = random.nextInt(LOOP - 1);
            lru.put(r, r);
        }
        buf.insert(0, sw.toString());
        long used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(before GC): " + used);
        System.gc();
        used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(after GC): " + used);
View Full Code Here

Examples of xbird.util.datetime.StopWatch

    public void testInt2QMap() {
        StringBuilder buf = new StringBuilder(1024);
        System.gc();
        long free = SystemUtils.getHeapFreeMemory();
        buf.append(" free(init): " + free);
        StopWatch sw = new StopWatch("testInt2QMap");
        Int2QCache<Integer> lru = new Int2QCache<Integer>(LIMIT);
        for(int i = 0; i < LOOP; i++) {
            lru.put(i, i);
        }
        Random random = new Random();
        for(int i = 0; i < LOOP / 2; i++) {
            int r = random.nextInt(LOOP - 1);
            lru.put(r, r);
        }
        buf.insert(0, sw.toString());
        long used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(before GC): " + used);
        System.gc();
        used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(after GC): " + used);
View Full Code Here

Examples of xbird.util.datetime.StopWatch

    public void testLongLruMap() {
        StringBuilder buf = new StringBuilder(1024);
        System.gc();
        long free = SystemUtils.getHeapFreeMemory();
        buf.append(" free(init): " + free);
        StopWatch sw = new StopWatch("testLongLruMap");
        LongLRUMap<Integer> lru = new LongLRUMap<Integer>(LIMIT);
        for(int i = 0; i < LOOP; i++) {
            lru.put(i, i);
        }
        buf.insert(0, sw.toString());
        Random random = new Random();
        for(int i = 0; i < LOOP / 2; i++) {
            int r = random.nextInt(LOOP - 1);
            lru.put(r, r);
        }
View Full Code Here

Examples of xbird.util.datetime.StopWatch

    public void testLong2QMap() {
        StringBuilder buf = new StringBuilder(1024);
        System.gc();
        long free = SystemUtils.getHeapFreeMemory();
        buf.append(" free(init): " + free);
        StopWatch sw = new StopWatch("testLong2QMap");
        Long2QCache<Integer> lru = new Long2QCache<Integer>(LIMIT);
        for(int i = 0; i < LOOP; i++) {
            lru.put(i, i);
        }
        Random random = new Random();
        for(int i = 0; i < LOOP / 2; i++) {
            int r = random.nextInt(LOOP - 1);
            lru.put(r, r);
        }
        buf.insert(0, sw.toString());
        long used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(before GC): " + used);
        System.gc();
        used = free - SystemUtils.getHeapFreeMemory();
        buf.append(", used(after GC): " + used);
View Full Code Here

Examples of za.co.enerweb.toolbox.timing.Stopwatch

                + "sping localhost -c 12");
            System.exit(1);
        }
        CommandUtils cu = new CommandUtils();
        cu.setCommandAndArgs(args);
        Stopwatch sw = new Stopwatch();
        try {
            cu.excecute();
        } catch (IOException e) {
            log.error("Error while executing " + args[0], e);
        } finally {
            log.debug("Execution time: {}", sw.getDelta());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.