Skip to content
Snippets Groups Projects
Commit 2d250444 authored by Jomaro Rodrigues's avatar Jomaro Rodrigues
Browse files

funcionando com tempo de processamento

parent 04b8752b
No related branches found
No related tags found
1 merge request!1WIP: Development
......@@ -2,12 +2,11 @@ import os
import time
from script.base.dataframe_base import load_dataframes
from script.build_cache import build_cache
from datetime import timedelta
from script.analysis.degree_analysis import *
from script.utils.situations import *
from script.analysis.course_analysis import *
from datetime import timedelta
def analyze(submission):
start_time = time.clock()
start_time_exec = time.time()
......@@ -16,11 +15,15 @@ def analyze(submission):
build_cache(dataframe)
submission.process_time = round(time.clock() - start_time)
submission.save()
cpu_time = timedelta(seconds=round(time.clock() - start_time))
run_time = timedelta(seconds=round(time.time() - start_time_exec))
print("--- Tempo de CPU: {} ---".format(cpu_time))
print("--- Tempo total: {} ---".format(run_time))
def main():
start_time = time.clock()
start_time_exec = time.time()
......
......@@ -24,6 +24,8 @@ class Submission(models.Model):
processed = models.BooleanField(default=False)
process_time = models.IntegerField(null=True)
def path(self):
return path.join(settings.MEDIA_ROOT, self.course, str(self.id))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment