Implement multi-platform getTime function