Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProB 2 Jupyter Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB 2 Jupyter Kernel
Commits
74383e5f
Commit
74383e5f
authored
May 28, 2018
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Add test for :time command
parent
339386ca
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
notebooks/tests/time.ipynb
+108
-0
108 additions, 0 deletions
notebooks/tests/time.ipynb
with
108 additions
and
0 deletions
notebooks/tests/time.ipynb
0 → 100644
+
108
−
0
View file @
74383e5f
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
":time COMMAND [ARGS ...]\n",
"\n",
"Execute the given command and measure how long it takes to execute."
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":help :time"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`:time` works for commands."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Execution time: 1.029668114 seconds\n"
]
},
{
"data": {
"text/plain": [
"null"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":time :groovy Thread.sleep(1000)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`:time` works for expressions."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Execution time: 1.079495268 seconds\n"
]
},
{
"data": {
"text/plain": [
"{12345,24690,37035,49380,61725,74070,86415,98760}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":time {x | x : 1..100000 & x mod 12345 = 0}"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ProB 2",
"language": "prob",
"name": "prob2"
},
"language_info": {
"file_extension": ".prob",
"mimetype": "text/x-prob",
"name": "prob"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
%% Cell type:code id: tags:
```
prob
:help :time
```
%% Output
:time COMMAND [ARGS ...]
Execute the given command and measure how long it takes to execute.
%% Cell type:markdown id: tags:
`:time`
works for commands.
%% Cell type:code id: tags:
```
prob
:time :groovy Thread.sleep(1000)
```
%% Output
Execution time: 1.029668114 seconds
null
%% Cell type:markdown id: tags:
`:time`
works for expressions.
%% Cell type:code id: tags:
```
prob
:time {x | x : 1..100000 & x mod 12345 = 0}
```
%% Output
Execution time: 1.079495268 seconds
{12345,24690,37035,49380,61725,74070,86415,98760}
This diff is collapsed.
Click to expand it.
dgelessus
@dgelessus
mentioned in issue
#6 (closed)
·
May 28, 2018
mentioned in issue
#6 (closed)
mentioned in issue #6
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment