void runEx() throws IOException, InterruptedException
        {
            log.seekPositionFraction(skip);

            while (lcm.getNumSubscriptions()==0)
                Thread.sleep(10);

            Thread.sleep((int) (delay*1000));

            long lastLocalUtime = System.nanoTime()/1000;
            long lastEventUtime = -1;
            double delayAccumulator = 0; // how long do we need to delay in real time?

            double verboseAccumulator = 0;
            long   verboseLastEventUtime = -1;

            while (true) {
                Log.Event ev = log.readNext();

                // how much time elapsed when the log was recorded?
                // we have to wait some fraction of the time...
                if (lastEventUtime > 0) {
                    double dt = (ev.utime - lastEventUtime) / 1000000.0;
                    if (dt > 0 && speed > 0)
                        delayAccumulator += dt / speed;
                }
                lastEventUtime = ev.utime;

                // subtract any clock time that has elapsed.
                long localUtime = System.nanoTime()/1000;
                double dt = (localUtime - lastLocalUtime)/1000000.0;
                lastLocalUtime = localUtime;
                delayAccumulator -= dt;
                verboseAccumulator += dt;

                // spit out some info at 1Hz
                if (verboseAccumulator > 1.0 && verbose) {
                    double eventDt = (lastEventUtime - verboseLastEventUtime)/1000000.0;
                    verboseLastEventUtime = lastEventUtime;
                    System.err.printf("LogFile: rate = %8.3f, position = %8.3f %%\n",
                                      eventDt/verboseAccumulator,
                                      log.getPositionFraction()*100.0);
                    verboseAccumulator = 0;
                }

                // sleep if necessary.
                if (delayAccumulator > 0.001) {
                    int ms = (int) (delayAccumulator*1000);
                    Thread.sleep(ms);
                }

                // dispatch the message
                lcm.receiveMessage(ev.channel, ev.data, 0, ev.data.length);
            }
        }