Skip to content

Commit

Permalink
Remove unused logger and add CPU cores print statement
Browse files Browse the repository at this point in the history
Eliminated the unused logger import and logger instance. Added a print statement to display the number of CPU cores available at runtime.
  • Loading branch information
kousen committed Aug 14, 2024
1 parent a7b916a commit 1165101
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/lazy/LazyStreams.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package lazy;

import java.util.logging.Logger;
import java.util.stream.IntStream;

public class LazyStreams {
private static final Logger logger = Logger.getLogger(LazyStreams.class.getName());

public static int multByTwo(int n) {
System.out.printf("Inside multByTwo with arg %d on thread %s%n",
Expand All @@ -26,6 +24,7 @@ public static void main(String[] args) {
.findFirst().orElse(0);
System.out.println(firstEvenDoubleDivBy3);

System.out.println("Number of cores: " + Runtime.getRuntime().availableProcessors());

// Demonstrate laziness using print statements
firstEvenDoubleDivBy3 = IntStream.rangeClosed(100, 2_000_000)
Expand Down

0 comments on commit 1165101

Please sign in to comment.