Background: William Thomson, 1st Baron Kelvin,  (26 June 1824 - 17 December 1907) was a Scots-Irish mathematical physicist and engineer who was born in Belfast in 1824. At the University of Glasgow he did important work in the mathematical analysis of electricity and formulation of the first and second laws of thermodynamics, and did much to unify the emerging discipline of physics in its modern form. He worked closely with mathematics professor Hugh Blackburn in his work.
Context: William's father was able to make a generous provision for his favourite son's education and, in 1841, installed him, with extensive letters of introduction and ample accommodation, at Peterhouse, Cambridge. In 1845 Thomson graduated as Second Wrangler. He also won the First Smith's Prize, which, unlike the tripos, is a test of original research. Robert Leslie Ellis, one of the examiners, is said to have declared to another examiner "You and I are just about fit to mend his pens."  While at Cambridge, Thomson was active in sports, athletics and sculling, winning the Colquhoun Sculls in 1843. He also took a lively interest in the classics, music, and literature; but the real love of his intellectual life was the pursuit of science. The study of mathematics, physics, and in particular, of electricity, had captivated his imagination.  In 1845, he gave the first mathematical development of Faraday's idea that electric induction takes place through an intervening medium, or "dielectric", and not by some incomprehensible "action at a distance". He also devised the mathematical technique of electrical images, which became a powerful agent in solving problems of electrostatics, the science which deals with the forces between electrically charged bodies at rest. It was partly in response to his encouragement that Faraday undertook the research in September 1845 that led to the discovery of the Faraday effect, which established that light and magnetic (and thus electric) phenomena were related.  He was elected a fellow of St. Peter's (as Peterhouse was often called at the time) in June 1845. On gaining the fellowship, he spent some time in the laboratory of the celebrated Henri Victor Regnault, at Paris; but in 1846 he was appointed to the chair of natural philosophy in the University of Glasgow. At twenty-two he found himself wearing the gown of a learned professor in one of the oldest Universities in the country, and lecturing to the class of which he was a first year student but a few years before.
Question: How long did he teach?. Whats the answer?