Estimate Backup/Restore times

The following sql sentence will be helpful to estimate the backup and restore times and see percent completed while the operation is running:

USE master

SELECT
result.session_id,
result.command,
CONVERT(NUMERIC(6,2),result.percent_complete) AS [Percent Completed],
CONVERT(VARCHAR(20),DATEADD(ms,result.estimated_completion_time,GetDate()),20) AS [Estimated Completion Time],
CONVERT(NUMERIC(6,2),result.total_elapsed_time/1000.0/60.0) AS [Elapsed Minute],
CONVERT(NUMERIC(6,2),result.estimated_completion_time/1000.0/60.0) AS [Estimated Minutes],
CONVERT(NUMERIC(6,2),result.estimated_completion_time/1000.0/60.0/60.0) AS [Estimated Hours],
CONVERT(VARCHAR(100),(SELECT SUBSTRING(text,result.statement_start_offset/2,
CASE
WHEN result.statement_end_offset = -1 THEN 1000
ELSE (result.statement_end_offset-result.statement_start_offset)/2
END)
FROM sys.dm_exec_sql_text(sql_handle)))
FROM sys.dm_exec_requests result
WHERE command IN (‘RESTORE DATABASE’,’BACKUP DATABASE’,’RESTORE LOG’,’BACKUP LOG’)