Skip to content

Negative duration issue #18181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1-more opened this issue Oct 20, 2014 · 1 comment
Closed

Negative duration issue #18181

1-more opened this issue Oct 20, 2014 · 1 comment

Comments

@1-more
Copy link
Contributor

1-more commented Oct 20, 2014

Technically speaking the negative duration is not the valid ISO 8601, but we need to print it anyway.
This code:

use std::time::duration::Duration;

fn main() {
    let a = Duration::days(1) + Duration::seconds(1);

    println!("#1. Should be -{0}, in fact {1}", a, -a);

    let b = Duration::nanoseconds(1);

    println!("#2. Should be -{0}, in fact {1}", b, -b);
}

Produces:

Should be -P1DT1S, in fact P-1DT-1S
Should be -PT0.000000001S, in fact PT-1.999999999S

@emberian
Copy link
Member

Cc @brson

@bors bors closed this as completed in 9bf82fa Oct 30, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Oct 8, 2024
…vmmx, r=davidbarsky

internal: add tracing to project discovery and VFS loading

With `"env RA_PROFILE=vfs_load|parallel_prime_caches|discover_command>500`, this results in the following output:

```
21888ms discover_command
11627ms vfs_load @ total = 701
1503ms vfs_load @ total = 701
30211ms parallel_prime_caches
```

As a followup, I'd like to make hprof emit the information above as JSON.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants