Skip to content

Commit e66883e

Browse files
committed
Add benchmark for _does_string_look_like_datetime
1 parent 61d8e6e commit e66883e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

asv_bench/benchmarks/io/parsers.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from pandas._libs.tslibs.parsing import _does_string_look_like_datetime
2+
3+
4+
class DoesStringLookLikeDatetime(object):
5+
6+
params = (['2Q2005', '0.0', '10000'],)
7+
param_names = ['value']
8+
9+
def setup(self, value):
10+
self.objects = [value] * 1000000
11+
12+
def time_check_datetimes(self, value):
13+
for obj in self.objects:
14+
try:
15+
_does_string_look_like_datetime(obj)
16+
except ValueError:
17+
pass
18+
19+
20+
from ..pandas_vb_common import setup # noqa: F401

0 commit comments

Comments
 (0)