Skip to content

Commit 84413e6

Browse files
committed
add asv
1 parent 96d7a95 commit 84413e6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

asv_bench/benchmarks/timestamp.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .pandas_vb_common import *
22
from pandas import to_timedelta, Timestamp
3+
import pytz
34

45

56
class TimestampProperties(object):
@@ -58,3 +59,17 @@ def time_is_leap_year(self):
5859

5960
def time_microsecond(self):
6061
self.ts.microsecond
62+
63+
64+
class TimestampOps(object):
65+
goal_time = 0.2
66+
67+
def setup(self):
68+
self.ts = Timestamp('2017-08-25 08:16:14')
69+
self.ts_tz = Timestamp('2017-08-25 08:16:14', tz='US/Eastern')
70+
71+
def time_replace_tz(self):
72+
self.ts.replace(tzinfo=pytz.timezone('US/Eastern'))
73+
74+
def time_replace_None(self):
75+
self.ts_tz.replace(tzinfo=None)

0 commit comments

Comments
 (0)