Skip to content

Commit 2fc2383

Browse files
committed
fixup! Add the Timers module to measure real-time and cpu-time
1 parent c618a2d commit 2fc2383

File tree

4 files changed

+72
-3
lines changed

4 files changed

+72
-3
lines changed

src/timers/darwin.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
##
2+
# Based upon https://github.com/google/benchmark
3+
#
4+
# Copyright 2015 Google Inc. All rights reserved.
5+
# Copyright 2017 Valentin Churavy. All rights reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
##
19+
120
const RUSAGE_SELF = Cint(0)
221
const RUSAGE_CHILDREN = Cint(-1)
322

src/timers/timers.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
#=
2-
Based upon https://github.com/google/benchmark
3-
=#
1+
##
2+
# Copyright 2017 Valentin Churavy. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
##
416

517
module Timers
618
import Compat

src/timers/unix.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
##
2+
# Based upon https://github.com/google/benchmark
3+
#
4+
# Copyright 2015 Google Inc. All rights reserved.
5+
# Copyright 2017 Valentin Churavy. All rights reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
##
19+
120
struct TimeSpec
221
tv_sec :: UInt64 # time_t
322
tv_nsec :: UInt64

src/timers/windows.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
##
2+
# Based upon https://github.com/google/benchmark
3+
#
4+
# Copyright 2015 Google Inc. All rights reserved.
5+
# Copyright 2017 Valentin Churavy. All rights reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
##
19+
120
"""
221
FileTime
322

0 commit comments

Comments
 (0)