Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java 8 dates and functional programming to write a timer

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question in the forum got me to write a timer. This was my first time instinctively doing so in Java 8. The result made for a nice blog post
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15283
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It reminds me of something similar I wrote in Scala.

Scala has a nicer syntax than Java to do this. With this method, you can just wrap the code you want to time in a time { ... } block:

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
 
Piet Souris
Rancher
Posts: 1264
26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can combine the two, like in


Greetz,
Piet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic