Skip to content

Commit

Permalink
Fix Linux compilation issue of ProfilingATNSimulator
Browse files Browse the repository at this point in the history
* NSEC_PER_SEC is available via CDispatch bindings, which are not currently imported
* Importing them would be heavy handed compared to replacing with the constant (and leaving a comment)

Signed-off-by: Will Ziener-Dignazio <wzienerdignazio@apple.com>
  • Loading branch information
WillDignazio committed Apr 22, 2024
1 parent 380ce4b commit 06cbc22
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ProfilingATNSimulator: ParserATNSimulator {
let start = ProcessInfo.processInfo.systemUptime //System.nanoTime(); // expensive but useful info
let alt: Int = try super.adaptivePredict(input, decision, outerContext)
let stop = ProcessInfo.processInfo.systemUptime //System.nanoTime();
decisions[decision].timeInPrediction += Int64((stop - start) * TimeInterval(NSEC_PER_SEC))
decisions[decision].timeInPrediction += Int64((stop - start) * TimeInterval(1_000_000_000)) // Nanoseconds per 1 Second
decisions[decision].invocations += 1

let SLL_k: Int64 = Int64(_sllStopIndex - _startIndex + 1)
Expand Down

0 comments on commit 06cbc22

Please sign in to comment.