Skip to content

Commit ba871d6

Browse files
committed
changes
1 parent 1463358 commit ba871d6

File tree

9 files changed

+228
-93
lines changed

9 files changed

+228
-93
lines changed

.github/workflows/TagBot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: TagBot
2+
on:
3+
schedule:
4+
- cron: 0 * * * *
5+
jobs:
6+
TagBot:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: JuliaRegistries/TagBot@v1
10+
with:
11+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
tags: '*'
10+
jobs:
11+
test:
12+
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
julia-version:
18+
- "1.3"
19+
- "1"
20+
- "nightly"
21+
os:
22+
- ubuntu-latest
23+
- macos-latest
24+
- windows-latest
25+
julia-arch:
26+
- x64
27+
exclude:
28+
- os: macOS-latest
29+
julia-arch: x86
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: julia-actions/setup-julia@v1
34+
with:
35+
version: ${{ matrix.julia-version }}
36+
arch: ${{ matrix.julia-arch }}
37+
- uses: actions/cache@v1
38+
env:
39+
cache-name: cache-artifacts
40+
with:
41+
path: ~/.julia/artifacts
42+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
43+
restore-keys: |
44+
${{ runner.os }}-test-${{ env.cache-name }}-
45+
${{ runner.os }}-test-
46+
${{ runner.os }}-
47+
- uses: julia-actions/julia-buildpkg@v1
48+
- uses: julia-actions/julia-runtest@v1
49+
- uses: julia-actions/julia-processcoverage@v1
50+
- uses: codecov/codecov-action@v1
51+
with:
52+
file: lcov.info
53+

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The TickTock.jl package is licensed under the MIT "Expat" License:
22

3-
> Copyright (c) 2020: cormullion.
3+
> Copyright (c) 2020-2022: cormullion.
44
>
55
> Permission is hereby granted, free of charge, to any person obtaining a copy
66
> of this software and associated documentation files (the "Software"), to deal

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TickTock"
22
uuid = "9ff05d80-102d-5586-aa04-3a8bd1a90d20"
33
authors = ["cormullion <cormullion@mac.com>"]
4-
version = "1.1.0"
4+
version = "1.2.0"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -13,4 +13,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1313
test = ["Test"]
1414

1515
[compat]
16-
julia = "1"
16+
julia = "1"

README.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# TickTock
22

3+
| **Build Status** | **Code Coverage** |
4+
|:-----------------------------------------:|:-------------------------------:|
5+
| [![Build Status][ci-img]][ci-url] | [![][codecov-img]][codecov-url] |
6+
7+
38
![tick tock](images/ticktock.gif)
49

5-
[![Build Status][travis-img]][travis-url] | [![][codecov-img]][codecov-url] | [![Build Status][appvey-img]][appvey-url]
6-
710
This module provides simple timer functions:
811

912
- `tick()` start a timer
@@ -28,29 +31,29 @@ You can:
2831
```julia
2932
julia> using TickTock
3033
julia> tick()
31-
Started timer at 2017-12-13T22:30:59.632
34+
[ Info: started timer at 2017-12-13T22:30:59.632
3235
julia> tock()
33-
55.052638936 ms: 55 seconds, 52 milliseconds
36+
[ Info: 55.052638936s: 55 seconds, 52 milliseconds
3437
```
3538
3639
- see how long your cup of tea's been brewing:
3740
3841
```julia
3942
julia> tick()
40-
Started timer at 2017-12-13T22:34:03.78
43+
[ Info: started timer at 2017-12-13T22:34:03.78
4144
julia> laptimer()
42-
72.625839832 ms: 1 minute, 12 seconds, 625 milliseconds
45+
[ Info: 72.625839832s: 1 minute, 12 seconds, 625 milliseconds
4346
julia> laptimer()
44-
266.053953749 ms: 4 minutes, 26 seconds, 53 milliseconds
47+
[ Info: 266.053953749s: 4 minutes, 26 seconds, 53 milliseconds
4548
julia> laptimer()
46-
285.314459174 ms: 4 minutes, 45 seconds, 314 milliseconds
49+
[ Info: 285.314459174s: 4 minutes, 45 seconds, 314 milliseconds
4750
```
4851
4952
- see how many seconds you held your breath for:
5053
5154
```julia
5255
julia> tick()
53-
Started timer at 2017-12-12T09:17:45.504
56+
[ Info: started timer at 2017-12-12T09:17:45.504
5457

5558
julia> tok()
5659
287.841546621
@@ -62,7 +65,7 @@ julia> tok()
6265
julia> tick()
6366
...go on holiday, then come back
6467
julia> laptimer()
65-
1.302200135485876e6s: 2 weeks, 1 day, 1 hour, 43 minutes, 20 seconds, 135 milliseconds
68+
[ Info: 1.302200135485876e6s: 2 weeks, 1 day, 1 hour, 43 minutes, 20 seconds, 135 milliseconds
6669
```
6770
6871
- time a number of things:
@@ -73,8 +76,8 @@ julia> tick()
7376
julia> tick()
7477
started timer at: 2018-03-17T12:14:03.077
7578
julia> laptimer()
76-
2 7.315769543s: 7 seconds, 315 milliseconds
77-
1 327.074715234s: 5 minutes, 27 seconds, 74 milliseconds
79+
2 [ Info: 7.315769543s: 7 seconds, 315 milliseconds
80+
1 [ Info: 327.074715234s: 5 minutes, 27 seconds, 74 milliseconds
7881
```
7982
8083
- set an alarm to wake up in 1m30s:
@@ -89,7 +92,16 @@ julia> @async alarm(now() + Dates.Minute(1) + Dates.Second(30))
8992
9093
```julia
9194
julia> @async alarm(now() + Dates.Minute(0) + Dates.Second(5),
92-
action = () -> run(`say "wake up"`)) # macOS speech command
95+
action = () -> run(`say "wake up"`)) # MacOS speech command
96+
```
97+
98+
- check alarms
99+
100+
```julia
101+
julia> alarmlist()
102+
103+
start | duration | finish | name
104+
13:22:37 | 00:01:30 | 13:24:07 | TickTock alarm
93105
```
94106
95107
You should *not* use this package to:
@@ -98,17 +110,18 @@ You should *not* use this package to:
98110
99111
- do benchmarking of Julia code
100112
101-
## History
113+
You can hide the message generated by `tick()` using:
102114
103-
Some of this code used to live in Julia Base in the `tic()`, `toc()`, and `toq()` functions (in base/util.jl). They were deprecated in GitHub issue [17046](https://github.com/JuliaLang/julia/issues/17046).
104-
105-
[pkgeval-link]: http://pkg.julialang.org/?pkg=TickTock
115+
```julia
116+
ENV["TICKTOCK_MESSAGES"] = false
117+
```
106118
107-
[travis-img]: https://travis-ci.org/cormullion/TickTock.jl.svg?branch=master
108-
[travis-url]: https://travis-ci.org/cormullion/TickTock.jl
119+
## History
109120
110-
[appvey-img]: https://ci.appveyor.com/api/projects/status/jfa9e54lv92rqd3m?svg=true
111-
[appvey-url]: https://ci.appveyor.com/project/cormullion/ticktock-jl/branch/master
121+
Some of this code used to live in Julia Base in the `tic()`, `toc()`, and `toq()` functions (in base/util.jl). They were deprecated in GitHub issue [17046](https://github.com/JuliaLang/julia/issues/17046).
112122
113123
[codecov-img]: https://codecov.io/gh/cormullion/TickTock.jl/branch/master/graph/badge.svg
114124
[codecov-url]: https://codecov.io/gh/cormullion/TickTock.jl
125+
126+
[ci-img]: https://github.com/cormullion/TickTock.jl/workflows/CI/badge.svg
127+
[ci-url]: https://github.com/cormullion/TickTock.jl/actions?query=workflow%3ACI

images/ticktock.gif

91.8 KB
Loading

0 commit comments

Comments
 (0)