Commit Graph

123 Commits

Author SHA1 Message Date
Jeroen van Rijn
bf53d2f6db Fix time.precise_clock on 32-bit platforms. 2024-08-10 12:44:40 +02:00
Jeroen van Rijn
d267735d99 Fixed time.precise_clock 2024-08-10 12:35:58 +02:00
Jeroen van Rijn
be7a1f671c Revert "Add time.precise_clock_from_time + time.precise_clock_from_duration"
This reverts commit c9ca192f33.
2024-08-10 03:26:09 +02:00
Jeroen van Rijn
c9ca192f33 Add time.precise_clock_from_time + time.precise_clock_from_duration 2024-08-10 03:23:08 +02:00
Jeroen van Rijn
00c6b83537 Use constants in example. 2024-07-25 21:02:38 +02:00
Jeroen van Rijn
ca7d86084e Improve docs. 2024-07-25 20:58:47 +02:00
Jeroen van Rijn
9088a493d9 Add time.to_string* formatters. 2024-07-25 19:43:42 +02:00
Jeroen van Rijn
9cad8179b7 Clarify core:time Unix timestamp 2024-07-22 20:00:25 +02:00
Jeroen van Rijn
cdd2c98b8d Merge pull request #3948 from flysand7/docs-time
[time]: Document all functions
2024-07-20 16:06:07 +02:00
flysand7
b3ca2d5e0a [time]: Document all functions 2024-07-20 18:48:50 +11:00
flysand7
0c78cab336 [time/datetime]: Document package datetime 2024-07-20 12:49:40 +11:00
Jeroen van Rijn
22fabba2f6 Fix #3873 2024-07-05 00:48:08 +02:00
Jeroen van Rijn
3af9d31bd5 Add time.from_nanoseconds 2024-06-23 00:19:24 +02:00
Feoramund
bd198aeada Fix #3460 2024-06-10 23:37:54 -04:00
gingerBill
3a9b86628a Add @(rodata) and @(static, rodata) where appropriate 2024-06-06 15:23:52 +01:00
Laytan Laats
8455e159f5 improve orca target 2024-06-05 20:57:39 +02:00
Feoramund
b2f9f0af68 Fix some typos 2024-06-04 19:01:30 -04:00
Jeroen van Rijn
b945e3e708 Limit to max of 9 fraction second digits, part deux. 2024-05-24 23:48:18 +02:00
Jeroen van Rijn
1473374bba Limit to max of 9 fraction second digits. 2024-05-24 23:45:46 +02:00
Jeroen van Rijn
3526042f1e Add dedicated ISO 8601 parser. 2024-05-24 23:40:14 +02:00
Jeroen van Rijn
e1c4b9b06a Allow lowercase z TZ indicator. 2024-05-24 19:16:24 +02:00
Vitalii Kravchenko
ff94ca9e42 Allow space (in addition to T and t) as RFC 3339 date/time separator. 2024-05-24 18:03:52 +01:00
Laytan Laats
f42b1c4973 add a default heap/general purpose allocator for wasm to base:runtime 2024-05-16 23:08:40 +02:00
Andreas T Jonsson
7feff1c113 Merged with master 2024-05-02 09:27:46 +02:00
Laytan Laats
cebe6bd982 sys/unix: add sysctlbyname for darwin 2024-04-30 00:24:09 +02:00
Andreas T Jonsson
4558f3992a Initial commit of NetBSD port 2024-04-16 14:27:29 +02:00
Chris
60478c0e07 Remove using from validate_datetime 2024-04-09 10:57:51 +01:00
Laytan Laats
667883b3d5 fix js_wasm time.tick_now, performance.now() returns a float 2024-04-08 13:53:16 +02:00
blob1807
8eed65ad4c Update time.odin 2024-03-26 11:20:05 +10:00
blob1807
bc0a2b8d39 Update time.odin 2024-03-26 11:17:44 +10:00
blob1807
a405c72d4d Updated windows time period call
Updated win32.time_begin_period to windows.timeBeginPeriod
Added a note about calling windows.timeEndPeriod once you don't need accurate_sleep, as per MS's docs https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod#remarks
2024-03-26 11:13:27 +10:00
Jeroen van Rijn
fda283c55e More better validation. 2024-03-20 23:09:09 +01:00
Jeroen van Rijn
ed5fd15f6e Ensmallen Date struct. 2024-03-20 18:13:29 +01:00
Jeroen van Rijn
89ca15014c Ensmallen Time struct. 2024-03-20 18:09:07 +01:00
Jeroen van Rijn
9c144dd24f Change Ordinal from int to i64 2024-03-20 17:56:22 +01:00
Jeroen van Rijn
72c15d7699 Add WiP datetime package and tests.
A new package `core:time/datetime` has been added which can represent moments much further in the past and future than `core:time`.
It is based on *the* reference work on the subject, Calendrical Calculations Ultimate Edition, Reingold & Dershowitz.

More procedures will be added to it in the future, to for example calculate the 3rd Thursday in March to figure out holidays.
The package has been tested for more than a year and can handle dates 25 quadrillion years into the past and future with 64-bit day ordinals, or 5 million with 32-bit ones.

This also fixes a longstanding bug where converting between YYYY-MM:DD hh:mm:ss and `time.Time` and back could result in a mismatch.

RFC 3339 timestamps can now also be parsed using the `core:time` package.
2024-03-18 16:47:16 +01:00
avanspector
f92042e7dd Merge branch 'odin-lang:master' into haiku 2024-03-01 00:42:28 +01:00
gingerBill
6805b85f89 Fix leap year bug 2024-02-29 20:20:37 +00:00
avanspector
c3746d9f56 fix core and libc 2024-02-25 03:32:35 +01:00
gingerBill
9a16bc5fc5 Remove core:os dependency for base:runtime 2024-01-28 22:40:46 +00:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
flysand7
4d65b1ab9c Implement new sys/unix package 2023-10-27 10:51:21 +11:00
Damian Tarnawski
c19af95db0 Fix calling time.now() in wasm js runtime 2023-10-19 18:45:04 +02:00
gingerBill
44ea82f845 Clean up usage of using throughout core and vendor 2023-07-31 11:46:40 +01:00
Jeroen van Rijn
0f9e747583 Merge pull request #2520 from matias-eduardo/master
Allow for custom sleep duration in tsc frequency fallback
2023-05-09 23:03:47 +02:00
Matias Fernandez
57c14f6a9b Allow custom sleep on tsc fallback.
This gives the user more control over the spectrum of precision vs. load time on Windows. Spall's output with much lower sleep times is still useful in my experience.

NOTE: A better API might be to allow the user to pass the freq as a param to "create_context" in case they already paid for it beforehand, but this seems fine for now.
2023-05-09 00:03:58 -04:00
Laytan Laats
c47dcbbe2f fix spacing 2023-05-06 19:39:39 +02:00
Laytan Laats
956ffdf654 add time.weekday proc 2023-05-05 20:55:59 +02:00
Colin Davidson
afaa5f2deb add null-impl for tsc_frequency for alt-platforms 2023-03-04 22:40:14 -08:00
Colin Davidson
c6f463b8c9 shuffle tsc around a little 2023-02-22 12:28:24 -08:00