I need to run a code during a specific time
for example, in Matlab I could do this easy as
k=1
Finaltime=zeros(1,300);
Finaltime(k)=0;
Max_time=30;
tic
while(toc <= Max_time)
do somthing;
k=k+1;
FinalTime(k)= toc
end
How to I replicated this in Python.