Q:

SQL Server Stored Procedure self-profiled for execution time? 

I need to find and store in a table the execution time of a procedure everytime it is being executed. 
Is there a way I can do it from within the procedure?  Lets say use a query to find  its execution time and write it inside a table? 
Any other better methods to record the execution times of the procedure other than use Profiler and filter thousand of thousands of records? 
Thank you

A:

You can simply use two parameters and initialize one at the start of the procedure and the next at the end of the procedure. 
create procedure myproc as
begin
    declare @start_time datetime = getdate()

    (rest of procedure code)

    declare @end_time datetime = getdate()
end

Right before exiting the procedure you can insert these values into a logging table. 
INSERT INTO Proc_Exec_Log (procedure_name, start_time, end_time) 
VALUES ('myproc', @start_time, @end_time);

