You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: timedwaitbar.m
    path of file: ./repos/acycle/code/package/wavelet
    
    the code of the file until where you have to start completion: function hout = timedwaitbar(x,txt)
% A waitbar with ETA, Estimated Time of Arrival...
%
% Usage: h=timedwaitbar(fraction_complete,textlabel)
%
% Fraction: is a number between 0 and 1. a value of 1 means completed and closes the window.
% h: window handle.
%
% some nice features:
% * Estimates how much time before completion.
% * Automatically open and close the waitbar window.
%     - It closes the window when fraction reaches 1
% * You can abort the program by closing the progressbar
%

    
function hout = timedwaitbar(x,txt)
% A waitbar with ETA, Estimated Time of Arrival...
%
% Usage: h=timedwaitbar(fraction_complete,textlabel)
%
% Fraction: is a number between 0 and 1. a value of 1 means completed and closes the window.
% h: window handle.
%
% some nice features:
% * Estimates how much time before completion.
% * Automatically open and close the waitbar window.
%     - It closes the window when fraction reaches 1
% * You can abort the program by closing the progressbar
%
% example use:
%
% for ii=1:1000
%   timedwaitbar(ii/1000)
%   q=isprime(ii+1000:10000);
% end