Bug 233556 - Console Timing API does not contain space before duration when it gets printed
Summary: Console Timing API does not contain space before duration when it gets printed
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-29 06:01 PST by Max Schmitt
Modified: 2022-02-12 23:04 PST (History)
14 users (show)

See Also:


Attachments
Patch (4.30 KB, patch)
2021-11-30 07:35 PST, Youssef Soliman
hi: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Schmitt 2021-11-29 06:01:22 PST
```js
console.time("MyTimer");
console.timeLog("MyTimer");
```

Expected:

```
MyTimer: 0.018 ms
```

Actual:

```
MyTimer: 0.018ms
```

There should be a space between the duration and the unit, see here in the spec: https://console.spec.whatwg.org/#timelog
Comment 1 Youssef Soliman 2021-11-30 07:35:05 PST
Created attachment 445416 [details]
Patch
Comment 2 Devin Rousso 2021-11-30 10:35:34 PST
(In reply to Max Schmitt from comment #0)
> There should be a space between the duration and the unit, see here in the spec: https://console.spec.whatwg.org/#timelog

I dont think this is correct.  The exact wording is

> Let _duration_ be a string representing the difference between the current time and _startTime_, in an implementation-defined format.

The only space that's required is between the `:` and the _duration_, which we already have.  The example includes spaces, but that's just an example not required output.
Comment 3 Youssef Soliman 2021-11-30 10:47:43 PST
(In reply to Devin Rousso from comment #2)
> (In reply to Max Schmitt from comment #0)
> > There should be a space between the duration and the unit, see here in the spec: https://console.spec.whatwg.org/#timelog
> 
> I dont think this is correct.  The exact wording is
> 
> > Let _duration_ be a string representing the difference between the current time and _startTime_, in an implementation-defined format.
> 
> The only space that's required is between the `:` and the _duration_, which
> we already have.  The example includes spaces, but that's just an example
> not required output.

Thanks, Devin, the spec never explicitly mentions a space between the value and unit in _duration_. For example, in the latest Node.js release, the output is `MyTimer: 0.018ms`.
Comment 4 Devin Rousso 2021-11-30 10:50:11 PST
Comment on attachment 445416 [details]
Patch

Our normal style in Web Inspector is to not have a space between the value and unit, so unless there's some compelling reason to do this I don't think we should break from our usual style.
Comment 5 Radar WebKit Bug Importer 2021-12-06 06:02:20 PST
<rdar://problem/86100703>