Skip to content

Commit

Permalink
Add fallback for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Jun 30, 2022
1 parent e624931 commit 05e6a4c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import scala.annotation.nowarn
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor}
import scala.concurrent.duration._
import scala.scalanative.libc.errno
import scala.scalanative.meta.LinktimeInfo
import scala.scalanative.unsafe._
import scala.util.control.NonFatal

Expand Down Expand Up @@ -65,7 +66,9 @@ abstract class PollingExecutorScheduler extends ExecutionContextExecutor with Sc

def nowMillis() = System.currentTimeMillis()

override def nowMicros(): Long = {
override def nowMicros(): Long = if (LinktimeInfo.isWindows) {
super.nowMicros()
} else {
import time._
val tp = stackalloc[timespec_t]()
if (clock_gettime(CLOCK_REALTIME, tp) != 0)
Expand Down

0 comments on commit 05e6a4c

Please sign in to comment.