What's the biggest time gap between authorship of two books of the Bible? What's the biggest time gap between authorship of two books of the Bible?

Honestly, I don't even know the order in which the books of the Bible were written, but I am quite interested in what the longest period of time that elapsed between two authorship of two books of the Scriptures.
The last book of the Old Testament, Malachi, was written about 443 B.C.  The first book of the New Testament, Matthew, was written about 40 A.D. leaving a 500 year gap between the Old and New Testament books. 

Second would be Joshua (~1450 BC) and Judges (written by Samuel ~1100 BC)