This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This would simulate a CPU running for 0.8 seconds | |
def foo(): | |
# work(75000) | |
work(8000) | |
# This would simulate a CPU running for 2.5 seconds | |
def bar(): | |
work(25000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# where each iteration simulates CPU time | |
def work(n): | |
i = 0 | |
while i < n: | |
i += 1 | |
# This would simulate a CPU running for 7.5 seconds | |
def foo(): | |
work(75000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from facebook_business.objects import AdCampaign | |
campaign = AdCampaign('<AD_CAMPAIGN_ID>') | |
params = { | |
'date_preset': AdCampaign.Preset.last_7_days, | |
} | |
insights = campaign.get_insights(params=params) | |
print insights |