Guest User

Untitled

a guest
Jan 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. class BasePacket(val priority : Priority,
  2. toRun : => Unit
  3. ) extends Runnable with Comparable[BasePacket] {
  4.  
  5. override def run() {
  6. val start = java.lang.System.nanoTime()
  7. toRun
  8. val end = java.lang.System.nanoTime()
  9. log("Timerec " + Thread.currentThread().getId() + " " + start + " " + end)
  10. }
  11.  
  12. override def compareTo(other : BasePacket) = priority.compareTo(other.priority)
  13. }
  14.  
  15.  
  16. class PerformerPacket(
  17. pri : Priority,
  18. key : Key
  19. )
  20. extends BasePacket(pri,this.sss()) {
  21. def sss() {}
  22. }
Add Comment
Please, Sign In to add comment