Create time.cpp

Solution for time