Package er.ticktock.ui

Source Code of er.ticktock.ui.TimeMeNow

package er.ticktock.ui;

import com.webobjects.appserver.WOComponent;
import com.webobjects.appserver.WOContext;
import com.webobjects.foundation.NSTimestamp;

public class TimeMeNow extends WOComponent {

  public TimeMeNow(WOContext context) {
    super(context);
  }

  public NSTimestamp startTime = new NSTimestamp();
  long startMillis = System.currentTimeMillis();

  public NSTimestamp endTime = null;
  long endMillis = 0L;

  public WOComponent clickNow() {
    endTime = new NSTimestamp();
    endMillis = System.currentTimeMillis();
    return null;
  }

  public int difference() {
    if (endMillis == 0L)
      return 0;
    else
      return (Long.valueOf((endMillis - startMillis) / 1000)).intValue() + 1;
  }
}
TOP

Related Classes of er.ticktock.ui.TimeMeNow

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.