Examples of ElapsedTime


Examples of net.sf.cindy.util.ElapsedTime

        public FileTransferHandler(File file) {
            this.file = file;
        }

        public void sessionStarted(Session session) throws Exception {
            elapsedTime = new ElapsedTime();
            if (fc == null)
                fc = new RandomAccessFile(file, "r").getChannel();

            sendName(session);
            sendContent(session);
View Full Code Here

Examples of net.sf.cindy.util.ElapsedTime

    public boolean complete(int timeout) {
        if (timeout < 0)
            throw new IllegalArgumentException();
        if (!completed) {
            ElapsedTime startTime = new ElapsedTime();
            synchronized (this) {
                while (!completed) {
                    long waitTime = timeout - startTime.getElapsedTime();
                    if (waitTime <= 0)
                        break;
                    dispatcher.block(); // block dispatcher
                    try {
                        wait(waitTime);
View Full Code Here

Examples of net.sf.cindy.util.ElapsedTime

    private synchronized void start() {
        if (selectThread != null)
            return;

        lastSelectTime = new ElapsedTime();
        try {
            selector = Selector.open();
            selectThread = reactorThreadFactory.newThread(new Runnable() {

                public void run() {
View Full Code Here

Examples of org.uncommons.watchmaker.framework.termination.ElapsedTime

                    requestThread.interrupt();
                }
            }
        });
        long startTime = System.currentTimeMillis();
        engine.evolve(10, 0, new ElapsedTime(timeout));
        long elapsedTime = System.currentTimeMillis() - startTime;
        assert Thread.interrupted() : "Thread was not interrupted before timeout.";
        assert elapsedTime < timeout : "Engine did not respond to interrupt before timeout.";
        assert engine.getSatisfiedTerminationConditions().isEmpty()
            : "Interrupted engine should have no satisfied termination conditions.";
View Full Code Here

Examples of org.uncommons.watchmaker.framework.termination.ElapsedTime


            public void islandPopulationUpdate(int islandIndex, PopulationData<? extends Integer> populationData){}
        });
        long startTime = System.currentTimeMillis();
        islandEvolution.evolve(10, 0, 10, 0, new ElapsedTime(timeout));
        long elapsedTime = System.currentTimeMillis() - startTime;
        assert Thread.interrupted() : "Thread was not interrupted before timeout.";
        assert elapsedTime < timeout : "Engine did not respond to interrupt before timeout.";
        assert islandEvolution.getSatisfiedTerminationConditions().isEmpty()
            : "Interrupted islands should have no satisfied termination conditions.";
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.