Williamson reaches 1,000 runs for calendar year
He had been within sight of the milestone in the first innings but was dismissed for 88 on the penultimate ball before tea on the first day.
The 25-year-old is averaging 90.18 runs an innings, with the match against Sri Lanka just his seventh test of the year.
His only failure was in the second test against England at Headingley in Leeds where he had innings of 0 and six, while he scored just 22 and two against Australia in the day-night test in Adelaide.
Williamson also has the third most runs in a calendar year by a New Zealander after scoring 929 runs in 2014.
Captain Brendon McCullum scored 1,164 runs in 2014, which included New Zealand's first test triple century.