Old English hwile, accusative of hwil "a space of time," from Proto-Germanic *hwilo (source also of Old Saxon hwil, Old Frisian hwile, Old High German hwila, German Weile, Gothic hveila "space of time, while"), originally "rest" (compare Old Norse hvila "bed," hvild "rest"), from PIE *kwi-lo-, suffixed form of root *kweie- "to rest, be quiet." Notion of "period of rest" became in Germanic "period of time."
Now largely superseded by time except in formulaic constructions (such as all the while). Middle English sense of "short space of time spent in doing something" now only preserved in worthwhile and phrases such as worth (one's) while. As a conjunction, "during or in the time that; as long as" (late Old English), it represents Old English þa hwile þe, literally "the while that." Form whiles is recorded from early 13c.; whilst is from late 14c., with unetymological -st as in amongst, amidst. Service while-you-wait is attested from 1911.