time bar function