Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions java/src/name/fraser/neil/plaintext/diff_match_patch.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public LinkedList<Diff> diff_main(String text1, String text2,
if (Diff_Timeout <= 0) {
deadline = Long.MAX_VALUE;
} else {
deadline = System.currentTimeMillis() + (long) (Diff_Timeout * 1000);
deadline = System.nanoTime() + (long) (Diff_Timeout * 1000000000l);
}
return diff_main(text1, text2, checklines, deadline);
}
Expand All @@ -151,7 +151,7 @@ public LinkedList<Diff> diff_main(String text1, String text2,
* @param checklines Speedup flag. If false, then don't run a
* line-level diff first to identify the changed areas.
* If true, then run a faster slightly less optimal diff.
* @param deadline Time when the diff should be complete by. Used
* @param deadline Time in nanoseconds when the diff should be complete by. Used
* internally for recursive calls. Users should set DiffTimeout instead.
* @return Linked List of Diff objects.
*/
Expand Down Expand Up @@ -382,7 +382,7 @@ protected LinkedList<Diff> diff_bisect(String text1, String text2,
int k2end = 0;
for (int d = 0; d < max_d; d++) {
// Bail out if deadline is reached.
if (System.currentTimeMillis() > deadline) {
if (System.nanoTime() > deadline) {
break;
}

Expand Down