Change time_per_piece to time_packet for we assume the size of a packet is same as a piece
Change function names in debug.cpp