preliminary data saving framework and time calculation