Created
February 15, 2017 21:56
-
-
Save themoah/b9e6ec764252e569b55167122936ad21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val MAX_SIZE = 10000000 | |
val reduceLeftStartTime = new java.util.Date | |
(1 to MAX_SIZE) reduceLeft (_ + _) | |
val reduceLeftEndTime = new java.util.Date | |
val reduceRightStartTime = new java.util.Date | |
(1 to MAX_SIZE) reduceRight (_ + _) | |
val reduceRightEndTime = new java.util.Date | |
val totalReduceLeftTime = reduceLeftEndTime.getTime - reduceLeftStartTime.getTime | |
val totalReduceRightTime = reduceRightEndTime.getTime - reduceRightStartTime.getTime | |
val theTruth = totalReduceRightTime > totalReduceLeftTime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment