summaryrefslogtreecommitdiff
path: root/src/pkg/time
Commit message (Collapse)AuthorAgeFilesLines
* build: move package sources from src/pkg to srcRuss Cox2014-09-0824-6708/+0
| | | | | | Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
* runtime: convert netpoll to GoDmitriy Vyukov2014-09-042-4/+5
| | | | | | | | | | The common code is converted, epoll and kqueue are converted. Windows and solaris are still C. LGTM=rsc R=golang-codereviews, rsc, dave CC=golang-codereviews, iant, khr, rsc https://codereview.appspot.com/132910043
* time: update generated zoneinfo_abbrs_windows.goAlex Brainman2014-09-021-4/+4
| | | | | | | | | | | The file in repo has been updated recently, but all these changes are gone off the web site now. It seems web site gets updated once in a while, so we'll update our file occasionally. LGTM=r R=golang-codereviews, r CC=golang-codereviews https://codereview.appspot.com/140780043
* time: use go generate rather than Makefile (windows only)Rob Pike2014-08-264-17/+25
| | | | | | | | | | Also make genzabbrs.go more self-contained. Also run it (on Linux; does that matter?) to update the table. LGTM=rsc R=rsc, alex.brainman CC=golang-codereviews https://codereview.appspot.com/128350044
* runtime: convert timers to GoDmitriy Vyukov2014-08-251-1/+1
| | | | | | | LGTM=rsc R=golang-codereviews, ruiu, rsc, daniel.morsing CC=golang-codereviews, khr https://codereview.appspot.com/123700044
* time: removed from tests now obsolete assumption about Australian tz ↵Alberto Donizetti2014-08-211-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | abbreviations Australian timezones abbreviation for standard and daylight saving time were recently changed from EST for both to AEST and AEDT in the icann tz database (see changelog on www.iana.org/time-zones). A test in the time package was written to check that the ParseInLocation function understand that Feb EST and Aug EST are different time zones, even though they are both called EST. This is no longer the case, and the Date function now returns AEST or AEDT for australian tz on every Linux system with an up to date tz database (and this makes the test fail). Since I wasn't able to find another country that 1) uses daylight saving and 2) has the same abbreviation for both on tzdata, I changed the test to make sure that ParseInLocation does not get confused when it parses, in different locations, two dates with the same abbreviation (this was suggested in the mailing list). Fixes issue 8547. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/130920043 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* runtime: remove now arg from timer callbackDmitriy Vyukov2014-08-212-4/+4
| | | | | | | | | | | Cleanup before converting to Go. Fortunately nobody using it, because it is incorrect: monotonic runtime time instead of claimed real time. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rsc https://codereview.appspot.com/129480043
* time: Fix missing colon when formatting time zone offsets with secondsJoel Stemmer2014-08-082-6/+7
| | | | | | | | | | | | | | | When formatting time zone offsets with seconds using the stdISO8601Colon and stdNumColon layouts, the colon was missing between the hour and minute parts. Fixes issue 8497. LGTM=r R=golang-codereviews, iant, gobot, r CC=golang-codereviews https://codereview.appspot.com/126840043 Committer: Rob Pike <r@golang.org>
* runtime: implement monotonic clocks on windowsAlex Brainman2014-08-011-3/+19
| | | | | | | | | Update issue 6007. LGTM=minux, dvyukov R=golang-codereviews, dvyukov, patrick, aram.h, minux CC=golang-codereviews https://codereview.appspot.com/108700045
* time: make it clearer that the reference time is the reference time.Rob Pike2014-07-281-2/+3
| | | | | | | | | | Because the reference time is the reference time but beginners seem to think otherwise, make it clearer you can't choose the reference time. LGTM=josharian, dave R=golang-codereviews, josharian, dave CC=golang-codereviews https://codereview.appspot.com/117250044
* time: minor typo in docMathieu Lonjaret2014-07-241-1/+1
| | | | | | | | | LGTM=minux R=golang-codereviews, minux CC=golang-codereviews https://codereview.appspot.com/120150043 Committer: Shenghou Ma <minux@golang.org>
* time: change nsec back to int32Russ Cox2014-07-161-13/+6
| | | | | | | | | | | The garbage collector and stack scans are good enough now. Fixes issue 7446. LGTM=r R=r, dvyukov CC=golang-codereviews, mdempsky, mtj https://codereview.appspot.com/112870046
* time: change formatting of microseconds duration to SI modifierRob Pike2014-06-123-13/+12
| | | | | | | | | 'u' is not micro, ? (U+00B5) is. LGTM=gri, bradfitz R=golang-codereviews, bradfitz, gri CC=golang-codereviews https://codereview.appspot.com/105030046
* time: avoid broken fix for buggy TestOverflowRuntimeTimerRob Pike2014-06-122-45/+12
| | | | | | | | | | | | | | | | | | The test requires that timerproc runs, but busy loops and starves the scheduler so that, with high probability, timerproc doesn't run. Avoid the issue by expecting the test to succeed; if not, a major outside timeout will kill it and let us know. As you can see from the diffs, there have been several attempts to fix this with chicanery, but none has worked. Don't bother trying any more. Fixes issue 8136. LGTM=rsc R=rsc, josharian CC=golang-codereviews https://codereview.appspot.com/105140043
* time: support version 3 zone recordsBrad Fitzpatrick2014-06-032-2/+11
| | | | | | | | | Fixes Issue 8134 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, r, rsc https://codereview.appspot.com/100930044
* std lib: fix various typos in commentsRobert Griesemer2014-05-021-1/+1
| | | | | | | | | | | Where the spelling changed from British to US norm (e.g., optimise -> optimize) it follows the style in that file. LGTM=adonovan R=golang-codereviews, adonovan CC=golang-codereviews https://codereview.appspot.com/96980043
* time: MeST is a time zone nameRui Ueyama2014-04-302-2/+3
| | | | | | | | | | | | Not only ChST but also MeST (America/Metlakatla) is a zone name containing a lower case letter. LGTM=robert.hencke, r R=golang-codereviews, robert.hencke, bradfitz, r CC=golang-codereviews https://codereview.appspot.com/99910043 Committer: Rob Pike <r@golang.org>
* all: fix typosRui Ueyama2014-04-161-1/+1
| | | | | | | | | LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/88670043 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* time: increase timeout in negative sleep duration testAndrew Gerrand2014-04-021-3/+2
| | | | | | | | | | There's enough jitter in the scheduler on overloaded machines that 25ms is not enough. LGTM=dave R=golang-codereviews, gobot, rsc, dave CC=golang-codereviews https://codereview.appspot.com/83300044
* time: add comment explaining rejection of years outside [0000,9999]Russ Cox2014-03-241-0/+2
| | | | | | | | | | This has come up twice now. Redirect future questions to the explanation in the issue tracker. LGTM=iant, r R=r, iant CC=golang-codereviews https://codereview.appspot.com/79550043
* time: handle int64 overflow in ParseDuration.Adam Langley2014-03-102-0/+4
| | | | | | | | | | Previously, passing a long duration to ParseDuration could result in random, even negative, values. LGTM=r R=golang-codereviews, bradfitz, r CC=golang-codereviews https://codereview.appspot.com/72120043
* all: merge NaCl branch (part 1)Dave Cheney2014-02-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See golang.org/s/go13nacl for design overview. This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come. CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately. The exact change lists included are 15050047: syscall: support for Native Client 15360044: syscall: unzip implementation for Native Client 15370044: syscall: Native Client SRPC implementation 15400047: cmd/dist, cmd/go, go/build, test: support for Native Client 15410048: runtime: support for Native Client 15410049: syscall: file descriptor table for Native Client 15410050: syscall: in-memory file system for Native Client 15440048: all: update +build lines for Native Client port 15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client 15570045: os: support for Native Client 15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32 15690044: net: support for Native Client 15690048: runtime: support for fake time like on Go Playground 15690051: build: disable various tests on Native Client LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/68150047 Committer: Russ Cox <rsc@golang.org>
* time: use RunParallel in benchmarksDmitriy Vyukov2014-02-241-18/+5
| | | | | | | LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/68060043
* runtime: use monotonic clock for timers (linux/386, linux/amd64)Jay Weisskopf2014-02-243-9/+7
| | | | | | | | | | | | | | | | | | | | | | | This lays the groundwork for making Go robust when the system's calendar time jumps around. All input values to the runtimeTimer struct now use the runtime clock as a common reference point. This affects net.Conn.Set[Read|Write]Deadline(), time.Sleep(), time.Timer, etc. Under normal conditions, behavior is unchanged. Each platform and architecture's implementation of runtime?nanotime() should be modified to use a monotonic system clock when possible. Platforms/architectures modified and tested with monotonic clock: linux/x86 - clock_gettime(CLOCK_MONOTONIC) Update issue 6007 LGTM=dvyukov, rsc R=golang-codereviews, dvyukov, alex.brainman, stephen.gutekanst, dave, rsc, mikioh.mikioh CC=golang-codereviews https://codereview.appspot.com/53010043 Committer: Russ Cox <rsc@golang.org>
* time: explicitely mention Tickers have to be stoppedPatrick M?zard2014-02-241-0/+1
| | | | | | | | | LGTM=rsc R=golang-codereviews, gobot, rsc CC=golang-codereviews https://codereview.appspot.com/64770043 Committer: Russ Cox <rsc@golang.org>
* time: use an alternative method of yielding during Overflow timer testDave Cheney2014-02-022-1/+12
| | | | | | | | | | | Fixes issue 6874. Use runtime.GC() as a stronger version of runtime.Gosched() which tends to bias the running goroutine in an otherwise idle system. This appears to reduce the worst case number of spins from 600 down to 30 on my 2 core system under high load. LGTM=iant R=golang-codereviews, lucio.dere, iant, dvyukov CC=golang-codereviews https://codereview.appspot.com/56540046
* time: use names for beginning and end of zone transition timesIan Lance Taylor2014-01-314-13/+20
| | | | | | | | | No functional changes, just more readable code. LGTM=r R=golang-codereviews, gobot, r CC=golang-codereviews https://codereview.appspot.com/59240043
* time: correctly handle timezone before first transition timeIan Lance Taylor2014-01-312-1/+121
| | | | | | | LGTM=r R=golang-codereviews, r, arnehormann, bradfitz CC=golang-codereviews https://codereview.appspot.com/58450043
* time: increase timeout of TestOverflowRuntimeTimer on Plan 9David du Colombier2014-01-271-2/+6
| | | | | | | LGTM=dvyukov R=dvyukov CC=golang-codereviews https://codereview.appspot.com/53000043
* time: break parse and formatting tests into a separate source fileRob Pike2014-01-162-500/+512
| | | | | | | | | No changes, just rearrangement. The tests were in need of a little housekeeping. R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/53400043
* all: add solaris build tagsAram H?v?rneanu2014-01-072-2/+2
| | | | | | | | R=golang-codereviews, minux.ma, gobot, rsc, dave CC=golang-codereviews https://codereview.appspot.com/36040043 Committer: Russ Cox <rsc@golang.org>
* time: add tests for Tick, NewTicker with negative durationShawn Smith2014-01-061-0/+18
| | | | | | | | R=golang-codereviews, gobot, r, bradfitz CC=golang-codereviews https://codereview.appspot.com/37660044 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* time: add tests for Duration.Nanoseconds, Duration.Minutes, and Duration.HoursShawn Smith2014-01-021-0/+54
| | | | | | | | R=golang-codereviews, rsc, dave CC=golang-codereviews https://codereview.appspot.com/42440043 Committer: Dave Cheney <dave@cheney.net>
* time: fix test error in Chinese edition of WindowsShenghou Ma2013-12-171-1/+1
| | | | | | | | On the Chinese Windows XP system that I'm using, GetTimeZoneInformation returns a struct containing "??????" (China Standard Time in Chinese) in both StandardName and DaylightName (which is correct, because China does not use DST). However, in registry, under key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time, the key Std and Dlt contain "??????" (China Standard Time in Chinese) and "??????" (China Summer Time in Chinese) respectively. This means that time.toEnglishName() cannot determine the abbreviation for the local timezone (CST) and causes test failures (time.Local is empty) R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/43210043
* time: correct path to time zone zip file on UnixRuss Cox2013-10-295-2/+35
| | | | | | | | | | | | | | Most Unix systems have their own time zone data, so we almost never get far enough in the list to discover that we cannot fall back to the zip file. Adjust testing to exercise the final fallback. Plan 9 and Windows were already correct (and are the main users of the zip file). R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/19280043
* time: fix ParseDuration overflow when given more than 9 digits on 32-bit archShenghou Ma2013-10-222-2/+4
| | | | | | | | | | Fixes issue 6617. R=golang-dev, rsc, r CC=golang-dev https://codereview.appspot.com/15080043 Committer: Russ Cox <rsc@golang.org>
* time: allow more time for TestOverflowRuntimeTimer to succeedAlex Brainman2013-09-091-1/+5
| | | | | | | | Attempting to fix windows gobuilders R=golang-dev, r CC=golang-dev https://codereview.appspot.com/13507044
* runtime: handle timer overflow in tsleepAnthony Martin2013-09-062-0/+69
| | | | | | | | | | | | | | Make sure we never pass a timer into timerproc with a negative duration since it will cause other timers to never expire. Fixes issue 5321. R=golang-dev, minux.ma, remyoudompheng, mikioh.mikioh, r, bradfitz, rsc, dvyukov CC=golang-dev https://codereview.appspot.com/9035047 Committer: Russ Cox <rsc@golang.org>
* time: add more docs on SleepBrad Fitzpatrick2013-08-281-1/+2
| | | | | | | | | | | Merge the comment from runtime/time.goc ("at least") and also note that negative is okay and won't crash. I see people going out of their way to avoid passing a negative value to Sleep. R=golang-dev, adg, r, alex.brainman CC=golang-dev https://codereview.appspot.com/13271045
* all: dragonfly supportJoel Sing2013-08-242-2/+2
| | | | | | | | Enable remaining packages (crypto, mime, path, time) to build on dragonfly. R=bradfitz CC=golang-dev https://codereview.appspot.com/13190043
* time: make timers heap 4-arySokolov Yura2013-08-211-18/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This slightly improves performance when a lot of timers are present $ misc/benchcmp ../old_timers_m.txt ../new_timers_m.txt benchmark old ns/op new ns/op delta BenchmarkAfterFunc 6884 6605 -4.05% BenchmarkAfterFunc-2 4473 4144 -7.36% BenchmarkAfterFunc-3 8601 6185 -28.09% BenchmarkAfterFunc-4 9378 8773 -6.45% BenchmarkAfter 7237 7278 +0.57% BenchmarkAfter-2 4638 3923 -15.42% BenchmarkAfter-3 8751 6239 -28.71% BenchmarkAfter-4 9223 8737 -5.27% BenchmarkStop 603 496 -17.74% BenchmarkStop-2 795 577 -27.42% BenchmarkStop-3 982 680 -30.75% BenchmarkStop-4 1164 739 -36.51% BenchmarkSimultaneousAfterFunc 657 593 -9.74% BenchmarkSimultaneousAfterFunc-2 816 757 -7.23% BenchmarkSimultaneousAfterFunc-3 844 830 -1.66% BenchmarkSimultaneousAfterFunc-4 785 771 -1.78% BenchmarkStartStop 238 239 +0.42% BenchmarkStartStop-2 249 234 -6.02% BenchmarkStartStop-3 271 268 -1.11% BenchmarkStartStop-4 293 295 +0.68% R=golang-dev, dvyukov, bradfitz, r CC=golang-dev https://codereview.appspot.com/13094043 Committer: Dmitriy Vyukov <dvyukov@google.com>
* all: protect alloc count tests by -testing.shortRob Pike2013-08-211-0/+3
| | | | | | | | | | Update issue 5000 Should reduce the flakiness a little. Malloc counting is important to general testing but not to the build dashboard, which uses -short. R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/12866047
* time: fix time zones yet again.Rob Pike2013-08-163-12/+61
| | | | | | | | | | | | This time we're going for 5! http://goo.gl/3ETYH7 Fixes issue 3790 Yeah, right. R=golang-dev, adg CC=golang-dev https://codereview.appspot.com/13002044
* time: expand acceptance of time zones when parsingRob Pike2013-08-151-14/+23
| | | | | | | | | | | | | | | | | | | | I tried to make it absolutely correct but there are too many conflicting definitions for the official list of time zones. Since when we're parsing we know when to expect a time zone and we know what they look like if not exactly what the definitive set is, we compromise. We accept any three-character sequence of upper case letters, possibly followed by a capital T (all four-letter zones end in T). There is one crazy special case (ChST) and the possibility of a signed hour offset for GMT. Fixes issue 3790 I hope forever, but I doubt that very much. R=golang-dev, adg CC=golang-dev https://codereview.appspot.com/12969043
* time: handle GMT possibly with offsetRob Pike2013-08-152-19/+64
| | | | | | | | | | Update issue 3790 Handle time zones like GMT-8. The more general time zone-matching problem is not yet resolved. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/12922043
* time: make Time implement encoding interfacesRuss Cox2013-08-142-21/+61
| | | | | | | | See golang.org/s/go12encoding for design. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/12706043
* time: match month and day names only when not followed immediately by a ↵Rob Pike2013-08-052-2/+20
| | | | | | | | | | | | lower-case letter Avoids seeing "Janet" as "Januaryet". Fixes issue 6020. R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/12448044
* various: deleted unused itemsRob Pike2013-08-033-18/+0
| | | | | | R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/12396043
* time: Allow Parse and Format to handle time zone offsets with secondsUlf Holm Nielsen2013-07-312-40/+126
| | | | | | | | | | | | Adds layout cases with seconds for stdISO8601 and stdNumTZ with and without colons. Update time.Format to append seconds for those cases. Fixes issue 4934. R=golang-dev, r, bradfitz CC=golang-dev https://codereview.appspot.com/8132044 Committer: Rob Pike <r@golang.org>
* time: find correct zone abbreviations even on non-English windows systemsAlex Brainman2013-07-101-1/+82
| | | | | | | | Fixes issue 5783 R=golang-dev, r CC=golang-dev https://codereview.appspot.com/10956043