Comments (6)
Apparently, that doesn't just happen with compile, but every time when Deno caches dependencies and shows their progress.
from deno.
Per std::time::SystemTime::elapsed
docs:
Returns the difference from this system time to the current clock time.
This function may fail as the underlying system clock is susceptible to drift and updates (e.g., the system clock could go backwards), so this function might not always succeed. If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from this time measurement to the current time.
We should probably remove .unwrap()
there and default to 0s duration there.
from deno.
Per
std::time::SystemTime::elapsed
docs:Returns the difference from this system time to the current clock time.
This function may fail as the underlying system clock is susceptible to drift and updates (e.g., the system clock could go backwards), so this function might not always succeed. If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from this time measurement to the current time.We should probably remove
.unwrap()
there and default to 0s duration there.
If defaulting to 0
is enough, I can create a PR for it!
from deno.
Also, it seems like docs are recommending to use Instant
instead.
To measure elapsed time reliably, use Instant instead.
But Instant
also has this note:
Note, however, that instants are not guaranteed to be steady. In other words, each tick of the underlying clock might not be the same length (e.g. some seconds may be longer than others). An instant may jump forwards or experience time dilation (slow down or speed up), but it will never go backwards. As part of this non-guarantee it is also not specified whether system suspends count as elapsed time or not. The behavior varies across platforms and rust versions.
Instants are opaque types that can only be compared to one another. There is no method to get โthe number of secondsโ from an instant. Instead, it only allows measuring the duration between two instants (or comparing two instants).
Would using Instant
instead of SystemTime
change the intended behaviour?
from deno.
@catuhana yes, that would work as well. This field is used for a very non-essential functionality that doesn't need to display very precise data, so anything that removes a potential panic is a good fix ๐
from deno.
Alright, thanks!
from deno.
Related Issues (20)
- Bug: Node `vm` doesn't have Node's `global` global HOT 6
- Bug: `worker_threads` missing `MessagePort` conversion in deeply nested object
- Analyze CJS re-exports in parallel
- Cache module emits in parallel
- fix: npm package "urllib": invalid type: map, expected a string HOT 6
- Bug: `jest` errors with Class constructor Process cannot be invoked without 'new'
- Panic with npm:@aws-sdk/client-s3 HOT 2
- LSP: auto import to `.js` file even though the actual file is a `.d.ts` file HOT 1
- LSP: auto import doesn't work correctly with project-root-for-absolute-imports mapping HOT 1
- :bug:(WinOS) `Deno.consoleSize()` incorrectly returns console buffer size
- BUG: `deno doc --lint` crash with non-ASCII ts code
- @deno-types breaks at 1.43.4 HOT 19
- `/// <reference types="..." />` stopped working in TypeScript files in the LSP in 1.43.0 HOT 1
- API to decode URI path segments
- "Uncaught SyntaxError: Unexpected token '<'" when using primitive as parameter in arrow function declaration HOT 1
- Supporting `vitest` tracking issue
- Bug: Panic when running astro's `test:node` task
- Deno v1.43.4 on Windows: WinGet installation or upgrade fails HOT 11
- reduce readFileSync syscall count HOT 2
- Diagnostic-languageserver stopped working in Deno >= 1.43 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno.