timefun/private/dateformverify (Calls: 30, Time: 0.038 s)
Generated 16-Jul-2020 17:09:38 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/timefun/private/dateformverify.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
datestr | function | 20 |
datevec>getformat | subfunction | 10 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
32 | S = char(formatdate([y,mo,d,h,... | 30 | 0.036 s | 93.2% | |
23 | [y,mo,d,h,minute,s] = datevecm... | 30 | 0.001 s | 3.7% | |
10 | if isempty(dtnumber) | 30 | 0.000 s | 0.0% | |
13 | end | 30 | 0.000 s | 0.0% | |
19 | end | 30 | 0.000 s | 0.0% | |
All other lines | 0.001 s | 3.1% | |||
Totals | 0.038 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
timefun/private/formatdate | function | 30 | 0.034 s | 89.6% | |
Self time (built-ins, overhead, etc.) | 0.004 s | 10.4% | |||
Totals | 0.038 s | 100% |
Total lines in function | 32 |
Non-code lines (comments, blank lines) | 16 |
Code lines (lines that can run) | 16 |
Code lines that did run | 8 |
Code lines that did not run | 8 |
Coverage (did run/can run) | 50.00 % |
time | Calls | line | |
---|---|---|---|
1 | function S = dateformverify(dtnumber, dateformstr, islocal) | ||
2 | %Helper function for datevec, to determine if a format is right or not. | ||
3 | %This is a simplified copy of datestr. Takes as input a date number, and a | ||
4 | %dateformat, and whether to localize or not. | ||
5 | |||
6 | % Copyright 2003-2011 The MathWorks, Inc. | ||
7 | |||
8 | %This is an internal function only. | ||
9 | |||
< 0.001 | 30 | 10 | if isempty(dtnumber) |
11 | S = reshape('', 0, length(dateformstr)); | ||
12 | return; | ||
< 0.001 | 30 | 13 | end |
14 | |||
< 0.001 | 30 | 15 | if ~isfinite(dtnumber) |
16 | %Don't bother to go through mex file, since datestr can not handle | ||
17 | %non-finite dates. | ||
18 | error(message('MATLAB:datestr:ConvertDateNumber')); | ||
< 0.001 | 30 | 19 | end |
20 | |||
< 0.001 | 30 | 21 | try |
22 | % Obtain components using mex file | ||
0.001 | 30 | 23 | [y,mo,d,h,minute,s] = datevecmx(dtnumber,true); mo(mo==0) = 1; |
24 | catch exception | ||
25 | newExc = MException('MATLAB:datestr:ConvertDateNumber','%s',... | ||
26 | getString(message('MATLAB:datestr:ConvertDateNumberVerify'))); | ||
27 | newExc = newExc.addCause(exception); | ||
28 | throw(newExc); | ||
< 0.001 | 30 | 29 | end |
30 | |||
31 | % format date according to data format template | ||
0.036 | 30 | 32 | S = char(formatdate([y,mo,d,h,minute,s],dateformstr,islocal)); |