add comment on setTimeout and reuse getResolution