Changed system to use Clock delta time rather than raw waiting

This fixes #1